繁体   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