是否有某种方法可以在R?
中的Linux计算机上访问Windows版本的帮助文件我在Linux机器上编写了大量的R代码,但我必须确保代码可以在Windows机器上运行,以供协作者使用。
我在Linux机器上阅读帮助文件,写了我的代码,然后花了好几个小时想知道为什么它不能在Windows机器上运行,直到我检查该机器上的帮助文件,我已经被烧了很多次并意识到它与Linux机器上的不同。
它通常会有一个“注意:在Windows上,xxxx表现不一样......”,我希望在我在Linux机器上编写代码时知道这一点!
我确实知道许多帮助文件是特定于系统的(例如?system
),但有时我想在Linux计算机上阅读Windows版本。今天我发现自己想要阅读?windows
但是必须启动我的Windows笔记本电脑才能阅读该帮助文件,因为该功能在Linux上不可用,因此没有帮助文件。
欢呼声。
答案 0 :(得分:5)
您可以随时查看为您提供明确条件的来源 - 来自man/system.Rd
:
#ifdef windows
Only double quotes are allowed on Windows: see the examples. (Note: a
Windows path name cannot contain a double quote, so we do not need to
worry about escaping embedded quotes.)
[...]
#endif
#ifdef unix
Unix-alikes pass the command line to a shell (normally \file{/bin/sh},
and POSIX requires that shell), so \code{command} can be anything the
shell regards as executable, including shell scripts, and it can
contain multiple commands separated by \code{;}.
[...]
#endif