R帮助不同操作系统上的文件

mat*_*fee 9 operating-system r

有没有办法在R中的Linux计算机上访问Windows版本的帮助文件?

我在Linux机器上编写了大量的R代码,但我必须确保代码可以在Windows机器上运行以供协作者使用.

通过在我的Linux机器上阅读帮助文件,编写我的代码,然后花了几个小时想知道为什么它不能在Windows机器上工作,直到我检查该机器上的帮助文件并意识到它是不同的,我已经被烧了很多次到Linux机器上的那个.

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

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

干杯.

Dir*_*tel 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
Run Code Online (Sandbox Code Playgroud)