Home > Net >  In google colab for R, how to install crimedata package?
In google colab for R, how to install crimedata package?

Time:12-10

I usually have no issues with installing packages in google colab for R, but I can't figure out how to fix the issues I'm having (non zero exit status).

install.packages("crimedata")

outputs

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

also installing the dependencies ‘s2’, ‘units’, ‘sf’


Warning message in install.packages("crimedata"):
“installation of package ‘s2’ had non-zero exit status”
Warning message in install.packages("crimedata"):
“installation of package ‘units’ had non-zero exit status”
 Warning message in install.packages("crimedata"):
“installation of package ‘sf’ had non-zero exit status”
Warning message in install.packages("crimedata"):

and so on...

when I try to import it from github, the same issue happens:

install.packages("devtools")
devtools::install_github("mpjashby/crimedata")

outputs

Warning message in install.packages("devtools"):
“installation of package ‘textshaping’ had non-zero exit status”

and so on.

alternatively... if anyone would be able to point me to anywhere online where I can find all the data in this package in a CSV, that would also solve my problem.

CodePudding user response:

Do this at the beginning.

system("sudo apt install libudunits2-dev")

Then install the crimedata package.

install.packages("crimedata", verbose=T, keep_outputs=T)

The verbose and keep_outputs create detailed output that is invaluable for debugging and which is stored in the /content folder. Ignore these options if you don't need the details.

  • Related