龙空技术网

Linux子系统安装R语言实现Jupyter中运行R代码

繁梦溪 60

前言:

此时朋友们对“r语言ubuntu”大致比较关切,大家都想要知道一些“r语言ubuntu”的相关知识。那么小编在网摘上汇集了一些对于“r语言ubuntu””的相关知识,希望看官们能喜欢,同学们快快来学习一下吧!

环境Windows子系统(Ubuntu18.04 LTS)Python(3.6)

ubuntu18.04

R的安装

# update indicesapt update -qq# install two helper packages we needapt install --no-install-recommends software-properties-common dirmngr# add the signing key (by Michael Rutter) for these repos# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc # Fingerprint: 298A3A825C0D65DFD57CBB651716619E084DAB9wget -qO-  | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as neededadd-apt-repository "deb  $(lsb_release -cs)-cran40/"

输入R出现如下显示则说明R安装成功

R

jupyter notebook里安装R核心

在R命令行下输入命令

install.packages('IRkernel')# 只在当前用户下安装IRkernel::installspec()# 或者是在系统下安装IRkernel::installspec(user = FALSE)
启动Jupyter

Jupyter

测试

R code

标签: #r语言ubuntu #r语言code