【发布时间】:2019-06-03 04:19:52
【问题描述】:
最近(2017 年)Windows 10 提供了一个可以完美运行的官方 Ubuntu 子系统(它不是虚拟机或像 Cywin 这样的应用程序)。 Windows 中的这个 Ubuntu 子系统提供了经典的 linux shell。
我正在使用 system() 命令在我的 Ubuntu 笔记本电脑中的 R 脚本中使用 CDO(气候数据运算符)。
system(paste0("cd ~/Data/; cdo -f nc copy file1.grb2 file2.nc;"))
但我需要在 Windows 计算机上运行我的代码。
我之前问过如何在 Windows 中使用 R 中的这个 system() 命令:How can I call a Windows Terminal inside an R script?,我了解到它与在 Ubuntu 中相同。
但我需要的是不同的:如何在 Windows 10 的 R 脚本中调用 Ubuntu Shell?
我考虑过使用某种类型的组合,例如
System(some-command-that-calls-ubuntu-terminal())
【问题讨论】:
标签: r windows shell ubuntu terminal