cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you install R packages?

flachboard
New Contributor

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’

3 REPLIES 3

ShinaultS
New Contributor II

@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.

Aashita
Databricks Employee
Databricks Employee

@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

Anonymous
Not applicable

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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group