r-raster-vector-geospatial icon indicating copy to clipboard operation
r-raster-vector-geospatial copied to clipboard

Consider using tidyterra for plotting

Open AndyBunn opened this issue 11 months ago • 1 comments

How could the content be improved?

The tidyterra library has a nice geom for SpatRaster objects. E.g.,

library(tidyterra)
DSM_HARV <-
  rast("/data/NEON-DS-Airborne-Remote-Sensing/HARV/DSM/HARV_dsmCrop.tif")
ggplot() + geom_spatraster(data = DSM_HARV , aes(fill = HARV_dsmCrop)) +
  scale_fill_viridis_c()

This would keep students from having to convert to data.frame or tibble for geom_raster

AndyBunn avatar Mar 24 '24 22:03 AndyBunn