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

Oleg Sklyar osklyar at ebi.ac.uk
Wed Sep 19 16:11:16 CEST 2007


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 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
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
-- 
Dr Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +44-1223-494466



More information about the R-devel mailing list