1

I've been trying to install some new packages on R, one of them being 'osmdata'. When I install it, I get this error:

Do you want to attempt to install these from sources? (Yes/no/cancel) no
installing the source package ‘reproj’

trying URL 'http://cran.rstudio.com/src/contrib/reproj_0.4.3.tar.gz'
Content type 'application/x-gzip' length 262365 bytes (256 KB)
==================================================
downloaded 256 KB

ERROR: dependency ‘proj4’ is not available for package ‘reproj’
* removing ‘/Users/~/Library/R/arm64/4.1/library/reproj’
Warning in install.packages :
  installation of package ‘reproj’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/79/pm85jx25579gy6lm3jwpym8h0000gn/T/RtmphhPiJA/downloaded_packages’
> library(osmdata)
Error in library(osmdata) : there is no package called ‘osmdata’

I get the same error when trying to install some other packages as well. Tried updating everything and it didn't work. It seems like the source packages are downloaded in a different folder rather than the usual package library folder. How can I solve this?

  • 1
    I suspect you haven't installed the system requirements for the proj4 package: https://cran.r-project.org/web/packages/proj4/index.html – Roland Jul 27 '23 at 10:49
  • 1
    When looking at CRAN pages for packages, if you see a `SystemRequirements:` listing, then it requires something that R itself cannot provide. In this case (`reproj`), it says `PROJ (>= 4.4.6)`. That listing is just literal text by the author (`proj4`, in contrast, lists `proj 4.4.6 or higher (https://proj.org/)`, slightly more descriptive), so some research is occasionally required. In this case, proj.org has an "Installation" page that lists steps for many OSes to install the (not-R) package. Good luck! – r2evans Jul 27 '23 at 11:08

0 Answers0