Collective Action
Collective Action

Reputation: 7999

Install R package in Jupyter

I have been trying over the weekend to install mosaic, car and some other packages on an R kernel (3.4.2) in Jupyter Notebook running Ubuntu 16.04. I have tried install.packages('car', '/home/jayaramdas/anaconda3/lib/R/library/', repos='http://cran.us.r-project.org'): it returns: also installing the dependency ‘pbkrtest’

Warning message in install.packages("car", "/home/jayaramdas/anaconda3/lib/R/library/", : “installation of package ‘pbkrtest’ had non-zero exit status”Warning message in install.packages("car", "/home/jayaramdas/anaconda3/lib/R/library/", : “installation of package ‘car’ had non-zero exit status”

I've tried installing it in the original R package and I get this: Warning messages: 1: In install.packages("car", "/home/jayaramdas/anaconda3/lib/R/library/", : installation of package ‘pbkrtest’ had non-zero exit status 2: In install.packages("car", "/home/jayaramdas/anaconda3/lib/R/library/", : installation of package ‘car’ had non-zero exit status

I tried using Rstudio to install it, but it won't let me write the file. I also tried downloading the zip file for Ubuntu and it still gave the 'non-zero exiterror. Is this a usual problem that people have withcar` and other R packages? I am just trying to figure how to add some packages to my jupyter notebook.

Upvotes: 0

Views: 2114

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368181

You are on Ubuntu. You want to use a package manager (conda).

May I suggest you use the native one?

sudo apt-get install r-cran-car

will install car and all its dependencies. If not, file an Ubuntu bug report.

Similarly, you can get many more packages from Ubuntu: apt-cache search 'r-cran-*'. And once you consider the Rutter PPAs you have a large part of CRAN prebuilt.

Upvotes: 1

Related Questions