我在我的Python腳本中通過rpy2
庫使用R
,我需要一個package,它不在R的默認安裝中。我該如何安裝它?R,Python:在rpy2上安裝軟件包
install.packages("DirichletReg", repos="http://r-forge.r-project.org")
將不起作用。
關於Python:
>>> install.packages("DirichletReg", repos="http://r-forge.r-project.org")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'install' is not defined
而且從R:
> install.packages("DirichletReg", repos="http://r-forge.r-project.org")
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘DirichletReg’ is not available (for R version 2.14.1)
不工作了。見Aaron的答案,現在起作用。 – wordsforthewise 2017-12-20 01:13:17