ggseg / ggsegExtra

Repository for extra atlases for the ggseg-package
https://ggseg.github.io/ggsegExtra/
Other
51 stars 18 forks source link

rgdal retired, causing issues for ggsegExtra on newer R versions #59

Open serenaverdi opened 10 months ago

serenaverdi commented 10 months ago

When installing ggsegExtra:-

ERROR: dependency ‘rgdal’ is not available for package ‘ggsegExtra’, as package ‘rgdal’ is not available for later versions of R (my version is 4.3.2 (2023-10-31))

Is there another way I can use ggsegExtra?

Thanks!

ramroomh commented 10 months ago

Try this:

# Download package tarball from CRAN archive: https://cran.r-project.org/src/contrib/Archive/rgdal/
url <- https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.6-7.tar.gz
pkgFile <- "rgdal_1.6-7.tar.gz"
download.file(url = url, destfile = pkgFile)

# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)

# Delete package tarball
unlink(pkgFile)

from: https://stackoverflow.com/questions/24194409/how-do-i-install-a-package-that-has-been-archived-from-cran

serenaverdi commented 10 months ago

Thanks, although it was unsuccessful (see below). I have downloaded gdal (via brew) too, but still no luck. Is there any other way to install ggsegExtra? Thanks for you help!

Install package

install.packages(pkgs=pkgFile, type="source", repos=NULL)

  • installing source package ‘rgdal’ ... package ‘rgdal’ successfully unpacked and MD5 sums checked using staged installation configure: R_HOME: /Library/Frameworks/R.framework/Resources configure: CC: clang -arch arm64 configure: CXX: clang++ -arch arm64 -std=gnu++17 configure: CFLAGS: -falign-functions=64 -Wall -g -O2 configure: CPPFLAGS: -I/opt/R/arm64/include configure: CXXFLAGS: -falign-functions=64 -Wall -g -O2 configure: LDFLAGS: -L/opt/R/arm64/lib configure: LDFLAGS: -L/opt/R/arm64/lib configure: CXX17 is: clang++ -arch arm64, CXX17STD is: -std=gnu++17 configure: CXX is: clang++ -arch arm64 -std=gnu++17 configure: C++17 support available configure: rgdal: 1.6-7 checking for /usr/bin/svnversion... no configure: svn revision: 1203 checking for gdal-config... no no configure: error: gdal-config not found or not executable. ERROR: configuration failed for package ‘rgdal’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgdal’ Warning in install.packages : installation of package ‘rgdal_1.6-7.tar.gz’ had non-zero exit status
ramroomh commented 10 months ago

Try downloading libgdal-dev via brew.

from: https://stackoverflow.com/questions/12141422/error-gdal-config-not-found-while-installing-r-dependent-packages-whereas-gdal

drmowinckels commented 10 months ago

@ramroomh thank you so much for assisting! I'm very busy with other tasks now, but I am paying attention and noting what is being tried, so I can hopefully fix things later.

amirhusseinab commented 9 months ago

@ramroomh I'm trying to use it on my Windows machine. Any suggestions for that? Searching for "rgdal" leads to this page: https://cran.r-project.org/web/packages/rgdal/index.html in which "sf" or "terra" are suggested as a substitute - which I think changes are required for ggsegExtra to be made.

drmowinckels commented 9 months ago

Info have a dev version of the package where i am trying to sub rgdal with sf, but its not working yet and its trickier than expected. I, unfortunately, don't have lots of time.to dedicate to the worn right now. I hope that changes after march

ramroomh commented 4 months ago

Hello everyone,

For now I've created a work around to the dependency problem, where I've created a docker image of an rstudio server with ggseg and associated packages preloaded (including rgdal).

Here are the steps in terminal, please note this requires installing docker and creating a docker hub account:

  1. Download the docker image docker pull ramroomh/ggseg-rstudio-server:v0.1

  2. run the image and port the image to a webserver docker run -d -p 8787:8787 -e PASSWORD=password --name ggseg-instance ramroomh/ggseg-rstudio-server:v0.1

  3. access the server on a web browser by pasting: http://localhost:8787

  4. login with default user and pass user: rstudio_user, pass: password

  5. start using ggseg

  6. export plots with: docker cp ggseg-instance:/home/rstudio_user/name_of_image.png /path/to/save/name_of_image.png

Currently it is preloaded with the brodmann atlas but happy to add the other atlases if there is interested.