par_pad_balanced | R Documentation |
This function utilizes anticlust::balanced_clustering()
to split the input into equal size subgroups then transform the data
to be compatible with the output of par_pad_grid
, for which
a set of padded grids of the extent of input point subsets
(as recorded in the field named "CGRIDID"
)
is generated out of input points.
par_pad_balanced(points_in = NULL, ngroups, padding)
points_in |
|
ngroups |
integer(1). The number of groups. |
padding |
numeric(1). A extrusion factor to make buffer to clip actual datasets. Depending on the length unit of the CRS of input. |
A list of two,
original
: exhaustive and non-overlapping
grid polygons in the class of input
padded
: a square buffer of each polygon in original
.
Used for computation.
Insang Song
Other Parallelization:
par_cut_coords()
,
par_grid()
,
par_grid_mirai()
,
par_hierarchy()
,
par_hierarchy_mirai()
,
par_make_dggrid()
,
par_make_grid()
,
par_make_h3()
,
par_merge_grid()
,
par_multirasters()
,
par_multirasters_mirai()
,
par_pad_grid()
,
par_split_list()
lastpar <- par(mfrow = c(1, 1))
library(terra)
library(sf)
options(sf_use_s2 = FALSE)
ncpath <- system.file("gpkg/nc.gpkg", package = "sf")
nc <- terra::vect(ncpath)
nc_rp <- terra::spatSample(nc, 1000)
nc_gr <- par_pad_balanced(nc_rp, 10L, 1000)
nc_gr
par(lastpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.