Displaying 1 result from an estimated 1 matches for "read_sf".
2023 Nov 20
1
Calculating volume under polygons
...ore than happy if anyone could help me.
I provided codes at the end of this email.
Sincerely
##########################################################################################
library(raster);
library(sf)
# Load the DEM raster and shapefile
r <- raster("E:/Base1.tif")
p <- read_sf(dsn = "E:/Sites.shp", layer = " Sites")
# Extract the values of the DEM raster for each polygon
values <- extract(r, p)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function
'addAttrToGeom': sp support...