cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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’

4 REPLIES 4

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
Contributor III
Contributor III

@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

Kaniz
Community Manager
Community Manager

Hi @Christopher Flach​ , Just a friendly follow-up. Do you still need help or you were able to find the solution? Please let us know.

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!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.