View source: R/dsmartr_iterate.R
iter_sample_poly | R Documentation |
Randomly selects n cells for sampling and assigns them a soil class based on the overlying map polygon's components.
iter_sample_poly(
pd = NULL,
cs = NULL,
ps = NULL,
nscol = NULL,
cellcol = NULL,
t_factor = NULL
)
pd |
A single-row sf object containing soil attributes and geometry. Usually output of running split(x, seq(nrow(x))) on a polygon sf dataframe. |
cs |
String; stub of attribute column names holding soil class data |
ps |
String; stub of attribute column names folding soil percentage data |
nscol |
String; name of attribute holding number of samples needed |
cellcol |
String; name of attriute holding list of raster cells to sample from |
t_factor |
Integer; dirichlet dampener, supplied by parent function |
A data frame containing two columns: weighted random allocation of soil classes, and cell numbers.
## Not run:
# run prep_polygons() and prep_points() examples, then:
sample_points <- iter_sample_poly(pd = pr_ap[1, ], cs = 'CLASS', ps = 'PERC',
nscol = 'n_samples', cellcol = 'intersecting_cells', t_factor = t_factor)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.