On 02.06.2023 09:05, Martin Maechler wrote:
Simon Urbanek
on Mon, 29 May 2023 07:36:46 -0500 writes:
> Dennis,
> PS1 is an internal shell environment variable (modifying prompt) which
has nohting to do with R (and nothing to do with the computer name by default) so
it won't
> Simon Urbanek
> on Mon, 29 May 2023 07:36:46 -0500 writes:
> Dennis,
> PS1 is an internal shell environment variable (modifying prompt) which
has nohting to do with R (and nothing to do with the computer name by default)
so it won't be set in R, only in a shell.
> If y
Dennis,
PS1 is an internal shell environment variable (modifying prompt) which has
nohting to do with R (and nothing to do with the computer name by default) so
it won't be set in R, only in a shell.
If you want the machine's hostname you'd typically use system("hostname") in R.
Cheers,
Simon
Iris
Thanks for the tip.
This works:
Sys.info()["nodename"]
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com
> On May 26, 2023, at 3:27 PM, Iris Simmons wrote:
>
> Hi,
>
>
> I think PS1 is generally a bash env
Hi,
I think PS1 is generally a bash environment variable. So if you're not
opening your R session from a bash session, then PS1 is likely undefined.
You could perhaps use `Sys.info()` instead if you wish to determine which
computer of yours is running the code.
On Fri, May 26, 2023 at 6:15 PM D
R 4.2.3
OS X
Colleagues
Interesting (minor) problem. I have code that I run automatically on two
different computers. The code runs from Dropbox so there is not separate code
for each computer.
In order to identify which computer is running the code, I was hoping to do
something like: