3

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

pd441
  • 2,644
  • 9
  • 30
  • 41
  • 2
    This could be because you have a different R installation and the package gets installed there. Have you tried adding something like `.libPaths("path/to/regular/R/libraries")` at the start of the notebook? – Sraffa Feb 09 '18 at 21:23
  • Did you find the solution? – Hadij Apr 01 '19 at 17:32
  • @ Sraffra, I have tried this on my JN but still have the same error. I have also looked to be sure that the pacakge is installed, and it is. The issue I have is [here](https://stackoverflow.com/questions/59212970/installed-package-on-anaconda-not-accessible-in-jupyter-notebook) – Collective Action Dec 06 '19 at 13:04

2 Answers2

1

try to install using a terminal instead of Jupyter environment:

conda install r-ldavis

or

conda install r-rocr

Then restart Jupyter notebook.

Hadij
  • 3,661
  • 5
  • 26
  • 48
0

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.

AJ Bensman
  • 550
  • 4
  • 11