在 R 中如何确定我正在哪个平台上运行?

发布于 2024-09-27 01:19:01 字数 344 浏览 0 评论 0原文

可能的重复:
R:确定脚本是否正在 Windows 中运行或Linux

R 脚本如何确定它在哪个平台上运行?我使用 R 2.10.1,有时在 Windows 上,有时在 Linux 上。我更喜欢内置函数而不是文件系统分类法。我已经在基本包的索引中搜索了描述中带有“os”或“platform”的任何内容 - 唉,那里没有骰子。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那小子欠揍 2024-10-04 01:19:02

R.version()$os 的替代方案是 .Platform$OS.typeR.Version()$platform。请参阅 ?.Platform 了解更多信息。请注意,Sys.info() 并未在所有平台上实现,但确实提供了 R 正在运行的平台的关键信息,而其他平台提供了有关 R 运行的平台的信息。 R 被构建

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.

罪#恶を代价 2024-10-04 01:19:02

您可以使用 R.Version()$os

You can use R.Version()$os

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文