
正文
Windows+anaconda+jupyter notebook+R+python3.6
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
Windows+anaconda+jupyter notebook+R+python3.6 环境配置
1. 设置国内清华大学镜像
打开 anaconda prompt,输入命令
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/win-64
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mro/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
2. 安装R
conda install R
3. 更新R
install.packages("installr")
require(installr)
updateR()
会弹出来安装地址,注意安装到anaconda/R路径下面,或者默认安装后把文件拷贝过来
4. 配置jupyter notebook
注意安装源选兰州的,不要选上海和广州!!!
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
# 只在当前用户下安装
IRkernel::installspec()
# 或者是在系统下安装
IRkernel::installspec(user = FALSE)
搞定!
安装R包的时候注意:
conda安装R包有两种方式,一种是使用conda命令安装:conda install -c r package-name,需要注意的是conda下面的r包的名称与普通R包的名称不一样,具体名称可以在官网上面查询(http://docs.anaconda.com/anaconda/packages/r-language-pkg-docs/);另外一种是直接进入conda下面的R交互界面,安装普通安装R包的方式进行安装,比如bioconductor或者install.packages方式。
参考:https://blog.csdn.net/weixin_44510615/article/details/92128641







