retirement of rgeos/rgdal/maptools

See: R-spatial evolution: retirement of rgdal, rgeos and maptools

These packages are being retired by the end of 2023. What packages are available to read shape files that do not require these packages? Or is that even possible right now.

I ask because I am having a problem with a tutorial that's failing in an rgdal call and I don't want to pursue the issue if there's new software out there.
TIA

The suggested course of action is to move to more current, actively developed packages. The actual type depends on your data - but for most vector data this would be {sf}, for spatio-temporal data {stars} and for raster data {terra}.

Also note that if you are following a tutorial that uses a rgdal call it is likely to be an oldish one (considering the breakneck dynamics of open source development) and liable to contain dated code. This can be in form of practices no longer considered "best" and / or using superseded tools & techniques - such as ggplot2::fortify() instead of ggplot2::geom_sf() to draw a map.

So proceed with extra caution - or consider a more recent tutorial, if one is available for your use case. But actually using rgdal in new code in 2022 is somewhat of a red flag.

If by "shape files" you mean the ESRI shapefiles I suggest sf::st_read(), as in:

library(sf)
library(ggplot2)

shape <- st_read(system.file("shape/nc.shp", package="sf"))   # included with sf package

ggplot(data = shape) +
  geom_sf()

1 Like

Hopping on to this thread after a number of failures trying to install rgdal package and searches for answers are closed and 3 years old.

Am I understanding correctly that rgdal and the packages mentioned in the OP are being phased out and that sf will perform the same functions as rgdal and sp package read commands?

New to the R universe, coming from landscape design and QGIS.

Thx

Yes, you are. Which is one of the reasons the older and more cumbersome of the two (i.e. rgdal) is being retired.

The functions are not named quite the same, but they are in principle equivalent - you can find a "Rosetta stone" translating old to new functions over here: Migrating · r-spatial/sf Wiki · GitHub

A comment relevant to QGIS user: {rgdal}, and {sf}, use GDAL, which is a C library that is used also in QGIS (and many, many other spatial data handling applications).

2 Likes

Thanks for the response. Very helpful. And thanks for the 'Rosetta stone' link!

1 Like

This topic was automatically closed 21 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.