我想知道如何在 R 中自动检测操作系统,例如将内容放入 .Rprofile 中。
最佳答案
switch(Sys.info()[['sysname']],
Windows= {print("I'm a Windows PC.")},
Linux = {print("I'm a penguin.")},
Darwin = {print("I'm a Mac.")})
由于我花了很多时间来解决这个问题,我认为其他人也会受益。
问候,
- 布莱恩
关于r - 检测 R 中的操作系统(例如,对于自适应 .Rprofile 文件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4463087/