From a0f49eb1de22cf71fa597bcff25aabc982e6d7d4 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Mon, 31 Jan 2022 17:04:47 +0100 Subject: [PATCH] spatial_crs_coding: replace proj4string<- by slot(, "proj4string")<- * This applies the request by Roger Bivand in https://github.com/r-spatial/discuss/issues/43#issuecomment-877305545. Apologies for this late update. --- content/tutorials/spatial_crs_coding/index.Rmd | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/content/tutorials/spatial_crs_coding/index.Rmd b/content/tutorials/spatial_crs_coding/index.Rmd index a104ce96f..aee38ddd8 100644 --- a/content/tutorials/spatial_crs_coding/index.Rmd +++ b/content/tutorials/spatial_crs_coding/index.Rmd @@ -342,11 +342,10 @@ coordinates(cities2) <- ~ X + Y Now, we can add a CRS: ```{r} -proj4string(cities2) <- crs_wgs84 +slot(cities2, "proj4string") <- crs_wgs84 ``` -Note the name of the `proj4string<-` replacement function in `sp`: it still reminds of old days, but the result is GDAL3/PROJ≥6 compliant! -Maybe we'll get another function in the future that cuts the link with the 'proj4string' name. +Note the name of the `proj4string` slot in `cities2`: it still reminds of old days, but the result is GDAL3/PROJ≥6 compliant! #### Get the CRS of a `Spatial*` object in `sp`