UCSBCarpentry / 2022-08-09-ucsb-r-geospatial

This is the repo for UCSB Lib's R Geospatial workshop on August 9 and 11, 2022
https://ucsbcarpentry.github.io/2022-08-09-ucsb-r-geospatial/
Other
0 stars 0 forks source link

Ep 11: Solution to first challenge #18

Open djhunter opened 2 years ago

djhunter commented 2 years ago

CHM_plots_HARVcrop <- crop(x = HARV_CHM, y = plot_locations_sp_HARV)

should be

CHM_plots_HARVcrop <- crop(x = HARV_CHM, y = HARV_plot_locations_sp)

ggplot() + geom_raster(data = CHM_plots_HARVcrop_df, aes(x = x, y = y, fill = HARV_chmCrop)) + scale_fill_gradientn(name = "Canopy Height", colors = terrain.colors(10)) + geom_sf(data = plot_locations_sp_HARV) + coord_sf()

should be:

ggplot() + 
  geom_raster(data = CHM_plots_HARVcrop_df, aes(x = x, y = y, fill = layer)) + 
  scale_fill_gradientn(name = "Canopy Height", colors = terrain.colors(10)) + 
  geom_sf(data = HARV_plot_locations_sp) + 
  coord_sf()