[R] cross-platform code: windows or gnu/linux?

krishna kumar kriskumar at mailandnews.com
Sun Jul 7 04:16:19 CEST 2002


Maybe something like this?

Platform <- function()
{list( OS.type = if(charmatch("ming", version$os, nomatch=0)) "windows" else
                if(exists("unix")) "unix"  else "unkown")
}

Russell Senior wrote:

> I am writing some R code that generates some figures.  I am primarily
> developing on GNU/Linux, but will ultimately run the code on Windows
> in order to get WMF files I can integrate in an existing document.
> The win.metafile() function, of course, doesn't exist in the GNU/Linux
> version of R.  I am contemplating writing an abstraction layer that
> runs the right thing, but I need to know how the code can figure out
> which platform it is running on.  I searched the mailing list archives
> and online docs but didn't find anything relevant.  Pointers?  Thanks
> in advance.
>
> --
> Russell Senior         ``The two chiefs turned to each other.
> seniorr at aracnet.com      Bellison uncorked a flood of horrible
>                          profanity, which, translated meant, `This is
>                          extremely unusual.' ''
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list