Hi,
I created a plot using geom_raster and geom_sf. The raster contains the EFT values for each pixel per year, and the shape file contains a list of species with coordinates. I would like to extract the values from the raster that corresponds to each species located in the shape file. The goal is to have a table with the list of species, coordinates, Year, and EFT value. Is this possible?
Guade<-st_read("~/iCloud Drive (Archive)/Documents/RStudio/FinalResearch/Diseno/Guadeloupe_Networks/Scripts/Guadeloupe.shp") %>%
mutate(Species = str_replace(Species, "_", " "))
Test<- Stacked_EFT %>%
select(x, y, `2001`) %>%
ggplot()+
geom_raster(aes(x = x, y = y, fill = `2001`))+
scale_fill_continuous_sequential(name="EFT", palette="YlGnBu")+
labs(title = "2001")+
theme(plot.title = element_text(size=20, face= "bold", hjust = 0.5), legend.position = "bottom")+
theme_void() +
coord_equal()+
geom_sf(data = Guade, aes(color = Species))
Thank you