Re: [Rd] How to test if R is running on a Mac

2007-09-21 Thread stefano iacus
what about > system("uname") > Darwin stefano On 19/set/07, at 16:34, Duncan Murdoch wrote: > On 9/19/2007 9:41 AM, Gorjanc Gregor wrote: >> Hi! >> >> Is there any way to test if R is running on a Mac? I usually use >> value of .Platform$OS.type for windows or unix, but Mac falls in the >> l

Re: [Rd] How to test if R is running on a Mac

2007-09-20 Thread Hin-Tak Leung
Prof Ripley had already spoken with a better solution (Sys.info())... The problem with system("uname") is that it depends on shell behavior and also the availability of an external utility - 'uname' - i.e. although it would work as intended on mac OS X, it would die on windows due to not having

Re: [Rd] How to test if R is running on a Mac

2007-09-20 Thread Keith Satterley
I use Sys.info()["sysname"]. It returns "Darwin" on a Mac, "Windows" on MS Windows and "Linux" on my Linux box. Is this sufficient for your needs, I'm using R-2.6.0alpha on MS Windows and 2.5.0 on Mac and Linux at the moment. cheers, Keith Satterley Bioinformatics Division The Walter and Eliza

Re: [Rd] How to test if R is running on a Mac

2007-09-20 Thread Prof Brian Ripley
On Thu, 20 Sep 2007, stefano iacus wrote: > what about > > > system("uname") > Darwin Why not use Sys.info() or R.version to find that? > stefano > p.s. if one day R will run on the iPhone, you have to change the > question below into "Do you see an apple logo somewhere on your > device?") And

Re: [Rd] How to test if R is running on a Mac

2007-09-20 Thread stefano iacus
what about > system("uname") Darwin stefano p.s. if one day R will run on the iPhone, you have to change the question below into "Do you see an apple logo somewhere on your device?") On 20/set/07, at 00:37, Hin-Tak Leung wrote: > On linux boxes, >version$os and R.version$os > is 'linux

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Hin-Tak Leung
On linux boxes, version$os and R.version$os is 'linux-gnu'. I assume that it would be 'darwin-apple' on Mac's? Henrik Bengtsson wrote: > isApple <- function(...) { > isApple <- FALSE; > tryCatch({ > ans <- readline("Do you see an Apple key on the keyboard you are > typing on? yes/no");

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Henrik Bengtsson
isApple <- function(...) { isApple <- FALSE; tryCatch({ ans <- readline("Do you see an Apple key on the keyboard you are typing on? yes/no"); isApple <- (ans == "yes"); }, mouseClick = function(ex) { isApple <<- TRUE; }) } /H On 9/19/07, Duncan Murdoch <[EMAIL PROTECTED]> wro

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Duncan Murdoch
On 9/19/2007 9:41 AM, Gorjanc Gregor wrote: > Hi! > > Is there any way to test if R is running on a Mac? I usually use > value of .Platform$OS.type for windows or unix, but Mac falls in the > latter group. Remember to also look at .Platform$GUI: the GUI version behaves quite differently from co

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > > Gregor Gorjanc-2 wrote: >> >> Hi! >> >> Is there any way to test if R is running on a Mac? I usually use >> value of .Platform$OS.type for windows or unix, but Mac falls in the >> latter group. >> >> Thanks, Gregor >> > > What is in .Platform$path.sep? > Wind

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Vladimir Eremeev
Gregor Gorjanc-2 wrote: > > Hi! > > Is there any way to test if R is running on a Mac? I usually use > value of .Platform$OS.type for windows or unix, but Mac falls in the > latter group. > > Thanks, Gregor > What is in .Platform$path.sep? Windows has ";", unix has ":". Mac? -- View this me

Re: [Rd] How to test if R is running on a Mac

2007-09-19 Thread Oleg Sklyar
I had the same problem. The following line using either 'apple' or 'darwin' does the job for me (tested on many different Macs): length(grep("apple", tolower(Sys.getenv("R_PLATFORM" != 0 On Wed, 2007-09-19 at 15:41 +0200, Gorjanc Gregor wrote: > Hi! > > Is there any way to test if R is run