2012-03-13 91 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