Reputation: 505
I updated my GDAL to 2.2.2 on Ubuntu and now rgdal
fails in R. I get this message when I try to load rgdal
(I also tried to update rgdal
, but didn't work).
Error in get(method, envir = home) :
lazy-load database '/home/R/x86_64-pc-linux-gnu-library/3.3/rgdal/R/rgdal.rdb' is corrupt
In addition: Warning messages:
1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :
restarting interrupted promise evaluation
2: In get(method, envir = home) :
restarting interrupted promise evaluation
3: In get(method, envir = home) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘rgdal’
Any ideas of how to fix this?
Upvotes: 6
Views: 1521
Reputation: 52308
brew install gdal
(this step may take a few minutes)brew upgrade gdal
(may take a few more minutes)install.packages("rgdal", repos = NULL, type="source")
Now try library(rgdal)
- it should succeed!
If the above steps don't work, try any of the following:
install.packages("path/to/downloaded/file/rgdal_1.5-23.tar.gz", repos = NULL, type="source")
rm /Users/$USER/Library/R/4.0/library/rgdal/R/rgdal.rdb
), then running install.packages("rgdal", repos = NULL, type="source")
, closing and reopening RStudio.install.packages("rgdal", repos="https://mac.R-project.org")
, close and reopen RStudio, and hopefully library(rgdal)
succeeds.Hope some of these notes helps someone else with this problem!
Upvotes: 1
Reputation: 71
This worked for me:
remove.packages("rgdal")
install.packages("rgdal")
library(rgdal)
Upvotes: 0
Reputation: 983
I was able to resolve this issue by deleting my corrupt rgdal installation, and simply reinstalling.
The warning message should indicate where it the folder is located (in your case /home/R/x86_64-pc-linux-gnu-library/3.3/rgdal
)
In your terminal, you can delete the installed version with
rm -rf path/to/rgdal
where path/to/rgdal
will be specific to your system and version. Then reinstall in R with install.packages('rgdal')
Upvotes: 2
Reputation: 15
I resolve it by updating and upgrading my system :
sudo apt update & sudo apt upgrade
Upvotes: 0