ggplot2 不存在于 python 的 rpy2 中?
我正在 Python3.2 中使用 rpy2 v2.1.9,我不明白为什么我不能使用库 ggplot2
import rpy2
from rpy2.robjects import r
r.library("ggplot2")
这是我收到的错误消息
Error in function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE, :
there is no package called 'ggplot2'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.2/dist-packages/rpy2/robjects/functions.py", line 82, in __call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
File "/usr/local/lib/python3.2/dist-packages/rpy2/robjects/functions.py", line 34, in __call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE, :
there is no package called 'ggplot2'
I am working with rpy2 v2.1.9 in Python3.2, I don't understand why I can't use the library ggplot2
import rpy2
from rpy2.robjects import r
r.library("ggplot2")
Here is the error message I got
Error in function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE, :
there is no package called 'ggplot2'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.2/dist-packages/rpy2/robjects/functions.py", line 82, in __call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
File "/usr/local/lib/python3.2/dist-packages/rpy2/robjects/functions.py", line 34, in __call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE, :
there is no package called 'ggplot2'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看第一条错误消息的尾部:
您需要先安装 ggplot2 软件包。启动 R 本身,然后说
See the tail of the first error message:
You need to install the
ggplot2
package first. Fire up R itself, and say