Closed rondon-d closed 8 months ago
Hello, I just my code to Terra and seems to be working with out issues. :)
You can probably reduce your script to:
library(terra)
x <- rast("Clc2018_FI20m.tif")
hex <- vect(st_as_sf(Hex.G)) |> project(x)
d <- extract(x, hex, fun="table")
hello all, I am having a strange issue with a mask function in raster in R. I want to crop the data of my raster file to a Simple feature that has a hexagon as a geometry type. I need to crop the data for 300 polygons and count how many characteristics are found in each one.
My R code looks as follow:
Data looks as follow:
The code works properly if i extract the information individually (not in a for loop). Inside a
for
usually works for 2 or 3 loops and then it provides the following error:Thank in advance!