How do you install R packages?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 09:35 AM
I've tried this, but it doesn't appear to be working: https://community.databricks.com/s/question/0D53f00001GHVX1CAP/unable-to-install-sf-and-rgeos-r-pack...
When I run the following after that init script, I receive an error.
library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 11:23 PM
@Christopher Flach , Download and install a package (you only need to do this once). To use the package, invoke the library(package) command to load it into the current session.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 11:55 PM
@Christopher Flach , can you paste the trail when you run this in the notebook?
%sh
#!/bin/bash
#Start with update
sudo apt-get update
#######rgdal
#This installs gdal on the linux machine but not the R library (done in R script)
sudo apt-get install -y gdal-bin libgdal-dev
#To be able to install the R library, you also need libproj-dev
sudo apt-get install -y libproj-dev
##### rgeos
sudo apt install libgeos++dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 09:17 AM
Hey there @Christopher Flach
Hope all is well!
Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!
![](/skins/images/8C2A30E5B696B676846234E4B14F2C7B/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/8C2A30E5B696B676846234E4B14F2C7B/responsive_peak/images/icon_anonymous_message.png)