Hi. Is there an easy way (analogous to the $^O variable in perl) to find out what operating system R is currently using? Thanks.
Try: .Platform$OS.type On Fri, Mar 5, 2010 at 11:45 AM, Rob Helpert <rhelpert at gmail.com> wrote:> Hi. > > Is there an easy way (analogous to the $^O variable in perl) to find > out what operating system R is currently using? > > Thanks. > > ______________________________________________ > R-help at r-project.org 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
On 05/03/2010 9:45 AM, Rob Helpert wrote:> Hi. > > Is there an easy way (analogous to the $^O variable in perl) to find > out what operating system R is currently using?.Platform is probably what you want. R.version gives related information. I don't think there's anything built in to determine platform version numbers. For instance, running 32-bit R on 64-bit Windows 7 .Platform says > .Platform $OS.type [1] "windows" $file.sep [1] "/" $dynlib.ext [1] ".dll" $GUI [1] "Rgui" $endian [1] "little" $pkgType [1] "win.binary" $path.sep [1] ";" $r_arch [1] "" Duncan Murdoch
See ?R.version ?Sys.info ?.Platform On Windows, ?win.version It all depends what you mean by 'Operating System'. On Fri, 5 Mar 2010, Rob Helpert wrote:> Hi. > > Is there an easy way (analogous to the $^O variable in perl) to findThat's a pretty basic description. Even R.version$os often gives more info. E.g. gannet% Rscript -e 'R.version$os' [1] "linux-gnu" gannet% perl -e 'print "$^O\n"' linux blacklark% Rscript -e 'R.version$os' [1] "darwin9.8.0" blacklark% perl -e 'print "$^O\n"' darwin blackhawk% Rscript -e 'R.version$os' [1] "solaris2.10" blackhawk% perl -e 'print "$^O\n"' solaris but note that on binary versions of R you may get the OS which it was compiled under (as in blacklark, which is running Mac OS X 10.6.2 aka Darwin 10.2.0) and that the name may be neither the name the OS itself reports nor the commonly used name. (Darwin vs Mac OS X, SunOS vs Solaris are examples.) system('uname -s', intern=TRUE) may be closer to what you are looking for (except on Windows).> out what operating system R is currently using?-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595