You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering whether it would be possible to incorporate a by = option into rasterize that allows you to rasterize vector data based on some factorial attribute and return a stack with one layer per factor level? It would be really useful in many situations e.g. rasterizing points by month or individual. At the moment I am doing it using a custom function:
rasterize_by(data, raster, by, ...){
rast(lapply(split(data, by), rasterize, y = raster, ...))
}
But the GIS students I teach aren't really aware of nesting and apply functions so it would be great to have it as a simple option in the CRAN version of the package. Apologies if there is already a way of doing this that I have missed!
Thanks,
Sam
The text was updated successfully, but these errors were encountered:
Hi,
I was wondering whether it would be possible to incorporate a
by =
option into rasterize that allows you to rasterize vector data based on some factorial attribute and return a stack with one layer per factor level? It would be really useful in many situations e.g. rasterizing points by month or individual. At the moment I am doing it using a custom function:rasterize_by(data, raster, by, ...){
rast(lapply(split(data, by), rasterize, y = raster, ...))
}
But the GIS students I teach aren't really aware of nesting and apply functions so it would be great to have it as a simple option in the CRAN version of the package. Apologies if there is already a way of doing this that I have missed!
Thanks,
Sam
The text was updated successfully, but these errors were encountered: