Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R package "rgdal" can not be installed

I have been using a code in R to create Kernel Density contours from a serie of GPS positions, and it's always been working nicely.

However, it seems like I can not use or install the rgdal package anymore. When I try to install it, it says:

Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'https://cran.rstudio.com/bin/windows/contrib/4.2/rgdal_1.6-7.zip' failed

Therefore, it seems that I can not use the sf, raster, writeRaster and readOGR functions, which I need to use in my code.

I am stuck and really need this code to work, and I could not find any solution to fix this. Any help would be highly appreciated. The whole code can be available on request.

At first there was an issue with the wrong RTools, but I fixed this. It just seems like the package does not exist anymore? Is there any replacement to it? I even downloaded an older version of RStudio that I know used to work with this package, but the problem is still the same.

Thank you so much.

like image 896
Strandwolf Avatar asked Sep 06 '25 08:09

Strandwolf


1 Answers

To make things work - try download the source code and get it locally installed?

  1. download whichever you want from here
  2. set working directory to where it was downloaded using setwd('/path/to/source/code/downloaded')
  3. install using install.packages('rgdal_xxx.tar.gz', repos = NULL, type = 'source')

Then it should be installed :)

like image 70
PHE Avatar answered Sep 09 '25 00:09

PHE