pd441
pd441

Reputation: 2763

Jupyter Notebook: Installing R packages

I have seen this question asked various times in stackoverflow, e.g the following:

error with install R packages on jupyter notebook

Error with install packages R on jupyter notebook

Install on jupyter notebook packages R

and

conda - How to install R packages that are not available in "R-essentials"?

However, the solutions offered haven't been working for me. I have tried to install the ROCR package in jupyter notebook and I get the following error:

enter image description here

Following the advice from this guide, I tried to replicate the example by installing the LDAvis package. First using conda in the ubuntu terminal as such:

conda skeleton cran ldavis

then

conda build r-ldavis/

However after doing this the package package doesn't install in jupyter, giving this instead:

I have also tried opening an R session in the terminal and installing the package there, however this doesn't help.

So in general how can I install R packages that aren't part of r-essentials, e.g. ROCR LDAvis? Probably I'm missing something very basic here, so any help would be greatly appreciated.

Thanks!

enter image description here

Upvotes: 3

Views: 6594

Answers (2)

AJ Bensman
AJ Bensman

Reputation: 580

The directions nobody else supplied worked for me on any other thread, but I found this guide, and it worked. https://developers.refinitiv.com/en/article-catalog/article/setup-jupyter-notebook-r

I already had R and python installed, so I skipped to step 3. The only seems to mention windows, but it worked for me on mac as well. After following them I was able to install the packages using install.packages("dplyr", repos = "http://cran.us.r-project.org") in a cell in jupyter.

Upvotes: 0

Hadij
Hadij

Reputation: 4630

try to install using a terminal instead of Jupyter environment:

conda install r-ldavis

or

conda install r-rocr

Then restart Jupyter notebook.

Upvotes: 1

Related Questions