簡體   English   中英

如何向R添加搜索路徑?

[英]How to add a search path to R?

本教程中,有一個命令pymol.dccm(cij, pdb, type="launch") 但有人告訴我

> pymol.dccm(cij, pdb, type="launch")
Error in pymol.dccm(cij, pdb, type = "launch") : 
  Launching external program failed
  make sure 'C:/python27/PyMOL/pymol.exe' is in your search path
In addition: Warning message:
running command 'C:/python27/PyMOL/pymol.exe -cq' had status 127

我已經在我的 PC 上安裝了pymol 我可以問如何向R添加另一個搜索路徑嗎?

現在我認為pymol是一個子包bio3d 但是我已經安裝了bio3d並且其他命令可以工作(例如pdb <- read.pdb() )。 但是為什么pymol命令不起作用?


我試過

> .libPaths("path/to/pymol2/")

> .libPaths("path/to/pymol2/PyMOL")

> .libPaths("path/to/pymol2/PyMOL/PyMOLWin.exe")

> pymol.dccm(cij, pdb, type="launch")
Error in pymol.dccm(cij, pdb, type = "launch") : 
  Launching external program failed
  make sure 'C:/python27/PyMOL/pymol.exe' is in your search path
In addition: Warning message:
running command 'C:/python27/PyMOL/pymol.exe -cq' had status 127 

> PyMOLWin.dccm(cij, pdb, type="launch")
Error: could not find function "PyMOLWin.dccm"

所以.libPaths沒有返回錯誤。 但是pymol.dccmPyMOLWin.dccm不起作用。


我還嘗試在R安裝pymol

> install.packages("pymol")
Warning in install.packages :
  package ‘pymol’ is not available (for R version 3.2.2)

教程命令本身存在錯誤。 dccm 的正確語法是

pymol(cij, pdb, type="launch",exefile="C:/Program Files/pymol")

其中exefile = file path系統上“PYMOL”程序的exefile = file path (即“PYMOL”是如何調用的)。 如果為 NULL,則使用依賴於操作系統的默認程序路徑。

嘗試以下代碼,它對我來說非常有效:

pymol(cm, pdb.open, type="launch", exefile="C:/Users/Oche/PyMOL/PyMOLWin.exe")

.libPaths("path/to/package/library")可能滿足您的需求。

.libPaths 獲取/設置在其中查找包的庫樹。

使用包名稱而不是包目錄本身設置到目錄的父目錄的路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM