gpt4 book ai didi

r - 错误 :root:Cell magic `%%R` not found

转载 作者:行者123 更新时间:2023-12-04 15:07:56 25 4
gpt4 key购买 nike

我有 python 3 环境

安装了 rpy2

conda install -c r rpy2=2.8.5

在 jupyter notebook 中加载 cell magic
%load_ext rmagic

当我尝试在笔记本中使用 R 块时,它给了我错误
ERROR:root:Cell magic `%%R` not found.

最佳答案

在终端中:

pip install rpy2

在笔记本中:
%load_ext rpy2.ipython

那么你可以使用 %%R :
%%R
var <- c(1, 2, 3)

关于r - 错误 :root:Cell magic `%%R` not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43682789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com