How can I determine in R what platform I'm running on? [duplicate]

落花浮王杯 提交于 2019-12-02 01:31:54

问题


Possible Duplicate:
R: determine if a script is running in Windows or Linux

How can an R script determine what platform it's running on? I'm using R 2.10.1, sometimes on Windows, sometimes on Linux. I would prefer a built-in function over filesystem taxonomy. I've already searched the index of the base package for anything with "os" or "platform" in the description — no dice there, alas.


回答1:


Alternatives to R.version()$os are .Platform$OS.type and R.Version()$platform. See ?.Platform for further info. Note that Sys.info() is not implemented on all platforms, but does give the key information on which platform R is running whereas the others give info on the platform under which R was built.




回答2:


You can use R.Version()$os



来源:https://stackoverflow.com/questions/3919621/how-can-i-determine-in-r-what-platform-im-running-on

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!