2012-03-13 53 views
10

有没有办法在R内的Linux计算机上访问Windows版本的帮助文件?在不同操作系统上的R帮助文件

我在Linux机器上写了大量的R代码,但是我必须确保代码能够在Windows计算机上运行,​​供合作者使用。

我一直在读一本帮助文件我的Linux机器上,写我的代码,然后花费数小时不知道为什么它没有在Windows机器上工作烧毁了多次,直到我检查了帮助文件该机器上并认识到它与Linux机器上的不同。

它通常会有一个“注意:在Windows上,xxxx的行为不同......”,我希望我知道在我的Linux机器上编写代码时!

我意识到许多帮助文件是系统特定的(例如?system),但有时我想在我的Linux计算机上阅读Windows版本。今天我发现自己想读?windows,但不得不启动我的Windows笔记本电脑只是为了读取该帮助文件,因为该功能在Linux上不可用,所以没有帮助文件。

欢呼声。

+0

德克的建议,另一种方法是保持的Windows版本的R参考指数的副本在你的Linux机器上。它是一个包含所有基本R包的帮助文件的单个巨大pdf,存储在'$ R_HOME/doc/manual/refman.pdf'中。你也可以研究将R的Windows安装的一部分复制到你的Linux机器上,然后在'help()'中使用lib.loc参数将帮助文件的搜索引导到Windows安装的可能性目录树。这似乎比它的价值更麻烦,但它取决于你。 – 2012-03-13 16:17:28

回答

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 
+0

谢谢 - 看起来像我可能要做的事情。但是,这是一个耻辱。 – 2012-03-13 03:56:54