NEFSC / NEFSC-Spatial

http://nefsc.github.io/NEFSC-Spatial
http://nefsc.github.io/NEFSC-Spatial
Other
7 stars 0 forks source link

amapps_grid from raster to sf #49

Closed jmhatch closed 1 year ago

jmhatch commented 1 year ago

The raster pkg in R depends on sp, which depends on maptools, rgdal, and rgeos. The latter 3 pkgs will be retired soon (by October 2023). I need to transfer the amapps_grid data from raster to terra. Unfortunately, there are issues with saving SpatRaster objects from terra using save (which is the method used by usethis::use_data). As a workaround, I'm going to save amapps_grid as an sf object with an example of how to convert the sf object into a SpatRaster object.

This is ugly, but should work. At least until I can figure out if and how to save SpatRaster objects in *.rda files.