Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using tidyterra for plotting #434

Open
AndyBunn opened this issue Mar 24, 2024 · 1 comment
Open

Consider using tidyterra for plotting #434

AndyBunn opened this issue Mar 24, 2024 · 1 comment

Comments

@AndyBunn
Copy link
Contributor

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

@jebyrnes
Copy link

Agree. I know it’s another dependency, but it takes away the need to continually turn rast objects into data frames, which confuses learners, and plays nice with geom_sf() for overlays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants