Simply trying to use a vector (.shp) to mask a SpatRaster using terra::mask
; get the following error
>Error: \[mask\] cannot create dataset
LCC84 <- rast("C:/Users_forest_VLCE2_1984.tif")
vec <- vect("C:/Users/Land_Management_Units.shp")
vec_proj <- project(vec, LCC84)
LCC84_masked <- terra::mask(LCC84, vec_proj)
Error: [mask] cannot create dataset
vec
#class : SpatVector
#geometry : polygons
#dimensions : 1, 8 (geometries, attributes)
#extent : -117.3165, -115.1691, 50.70613, 52.27127 (xmin, xmax, ymin, ymax)
#coord. ref. : lon/lat NAD83 (EPSG:4269)
LCC84
#class : SpatRaster
#dimensions : 128340, 193936, 1 (nrow, ncol, nlyr)
#resolution : 30, 30 (x, y)
#extent : -2660911, 3157169, -851351.9, 2998848 (xmin, xmax, ymin, ymax)
#coord. ref.: Lambert_Conformal_Conic_2SP
#source : CA_forest_VLCE2_1984.tif
#name : CA_forest_VLCE2_1984
crs(LCC84, proj=TRUE)
[1] "+proj=lcc +lat_0=49 +lon_0=-95 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs"