Skip to content
Back to formatted view

Raw Message

Message-ID: <ABCC4711-048D-48BF-AE98-BCB41F4BE379@me.com>
Date: 2011-02-25T20:56:04Z
From: Marc Schwartz
Subject: R in different OS
In-Reply-To: <77D349F144EC2D4DBCC9D8F66D26D3B22B601EA9AF@PAPABEAR.dataventures.local>

On Feb 25, 2011, at 12:23 PM, Hui Du wrote:

> Hi All,
> 
>                I have two Rs, one has been installed in Windows system and another one has been installed under UNIX system. Is there any environmental variable or function to tell me which R I am using? The reason that I need to know it is under different system, the data path could be different. I want to do something like
> 
> if it is R under Windows
> 
>                path = "/ABC"
> else if it is R under UNIX,
>                path = "/DEF"
> 
> Any idea? Thanks.
> 
> Best Regards,
> 
> HXD


See ?.Platform, more specifically:

On Unixen (eg. Linux, OSX)

> .Platform$OS.type
[1] "unix"

and on Windows, will be "windows".

If needed, look at the additional functions listed in the See Also on the help page (eg. ?Sys.info, etc.).

HTH,

Marc Schwartz