Rstudio can not install package 'rgdal'/'ggsegExtra'

When I install package 'ggsegExtra', there are some errors that I can not resolve. How can I install 'ggsegExtra' successfully?

> options(repos = c(
+   ggseg = 'https://ggseg.r-universe.dev',
+   CRAN = 'https://cloud.r-project.org'))

> # Install some packages

> install.packages('ggsegExtra')
also installing the dependency ‘rgdal’

trying URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/rgdal_1.6-7.tgz'
Warning in install.packages :
  downloaded length 0 != reported length 279
Warning in install.packages :
  cannot open URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/rgdal_1.6-7.tgz': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/rgdal_1.6-7.tgz'
Warning in install.packages :
  download of package ‘rgdal’ failed
installing the source package ‘ggsegExtra’

trying URL 'https://ggseg.r-universe.dev/src/contrib/ggsegExtra_1.5.33.004.tar.gz'
Content type 'application/x-gzip' length 3025022 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘ggsegExtra’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Warning in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  package ‘rgdal’ has no 'package.rds' in Meta/
Warning: S3 methods ‘print.GDALobj’, ‘print.ogrinfo’, ‘open.SpatialGDAL’, ‘close.SpatialGDAL’, ‘close.SpatialGDALWrite’, ‘print.summary.SpatialGDAL’, ‘print.coordOps’ were declared in NAMESPACE but not found
Error in library.dynam(lib, package, package.lib) : 
  shared object ‘rgdal.so’ not found
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace -> library.dynam
Execution halted
ERROR: lazy loading failed for package ‘ggsegExtra’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/ggsegExtra’
Warning in install.packages :
  installation of package ‘ggsegExtra’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/6r/fg89lrc13glcq3dcf6q3q3880000gn/T/RtmpGK87Uq/downloaded_packages’```

install.packages('ggseg3d', repos = c('https://ggseg.r-universe.dev', 'https://cloud.r-project.org'))

worked for me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.