# Voronoi tesselation
sfa_boundaries
bounds <- spm_as_boundary(boundaries = sfa_boundaries,
boundary = "sfa")
biomass_dataset <- spm_as_dataset(data.frame(borealis_simulated), name = "borealis",
density = "weight_per_km2",
time = "year_f",
coords = c('lon_dec','lat_dec'),
uniqueID = "uniqueID")
bounds_voronoi <- bounds %>%
spm_discretize(method = "tesselate_voronoi",
with = biomass_dataset,
nb_samples = 10)
# Custom method
custom_func <- function(boundaries, ...){
args <- list(...)
# Can access passed arguments with args$arg_name
# Do your custom discretization
# Careful: must return sf objects!
return(list(patches = c(),
points = c())
)
}
Run the code above in your browser using DataLab