Philippe Grosjean wrote:
> This question is probably trivial, but I don't find the answer. I have 
> code that is different for Windows, Unix/Linux and Mac OSX. The man page 
> of .Platform tells that .Platform$OS.type is the right way to test for 
> it... but it also tels that it returns either "windows" or "unix". Is 
> Mac OS X reported as "unix"? If yes, how do I make the difference?

At least the R GUI reports .Platform$OS.type as "unix" on Mac OS X. 
Sys.info() gives some additional information:

 > Sys.info()["sysname"]
  sysname
"Darwin"

Note that not all Darwins are necessarily Mac OS X. The R GUI has 
.Platform$GUI = "AQUA", which I believe is unique to Mac platform. Then 
again, I have no idea what R installed from sources, MacPorts or Fink 
reports. The GUI is probably different.

Also note that the Mac OS 10.4 has BSD inside by default, so you may get 
away with the same code for Unix/Linux and Mac.


HTH,
Jarimatti Valkonen

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to