[R] how can I write code to detect whether the machine is Windows or Linux?
Rolf Turner
r.turner at auckland.ac.nz
Thu Jul 24 00:11:08 CEST 2008
On 24/07/2008, at 9:53 AM, Philip James Smith wrote:
> Hi R-People:
>
> I use 2 machines: a machine with a Windows XP operating system, and
> another with a Linux Ubuntu OS. I transport my code between these 2
> machines. However, pathnames to data files always need to be
> "adjusted" to account for the OS that I'm working on.
>
> Here is my question:
>
> How do I write code to detect whether I'm using the XP or the Linux
> machine?
>
> If I knew this, I could write my code in a way so that I didn't
> have to adjust path names to data file all the time.
>
> I checked the archives... didn't find anything, but perhaps didn't
> know the right search terms...
The help for ``version'' says to use .Platform$OS.type
to check what platform the code is running on.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
More information about the R-help
mailing list