It is a pity that R programming language can't be compiled in Jupyter notebook by default, but we can solve it via Rstudio.

Replace software source:

Here, I choose Tuna's IPV6 CRAN source of Tsinghua University as an alternative.

https://mirrors6.tuna.tsinghua.edu.cn/CRAN/

Change directory to C:\Users\lixin.conda\pkgs\r-base-3.5.1-hac0af64_1\lib\R\etc, and type these code into "Rprofile.site".

# set a CRAN mirror
 local({r <- getOption("repos")
       r["CRAN"] <- "https://mirrors6.tuna.tsinghua.edu.cn/CRAN/"
      options(repos=r)})

Install dependent packages:

Run the Rstudio and enter this command in console.

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))

Git IRkernel packages:

devtools::install_github('IRkernel/IRkernel')

Install R kernel:

IRkernel::installspec(user = FALSE)

Now, you can create a new R project in Jupyter notebook(or Jupyter Lab).

Last modified: 2020年3月30日

Comments

Write a Reply or Comment

Your email address will not be published.