patch_subsample.Rd
Sample a connected patch of cells within an image
patch_subsample(
cells,
k.cells = NULL,
k.pavement = NULL,
k.stomata = NULL,
plot.patch = FALSE,
seed = NULL,
stom.val = 85,
subs.val = 170,
pave.val = 255
)
SpatialPolygonsDataFrame of all cells, with edge cells removed.
Numeric. Desired number of cells to be sampled in patch
Numeric. Desired number of pavement cells to be sampled in patch
Numeric. Desired number of stomata to be sampled in patch
Logical. Plot the sampling iterations? Defaults to FALSE.
Numeric. For reproducibility, the starting cell can be set using this argument.
Numeric vector of length 1. The value of stomatal cells (guard cells + pore)
Numeric vector of length 1. The value of subsidiary cells
Numeric vector of length 1. The value of pavement cells
A numeric vector containing the indices of the sampled polygons
If setting a seed using the seed
argument, cell numbers can be
displayed on a plot of the cells using: text(cells, labels = 1:length(cells))
.
if (FALSE) #
#minimum patch size of 40 cells
patch_subsample(cells, k.cells=40)
#patch must include at least 10 stomatal complexes and 30 pavement cells
patch_subsample(cells,k.pavement=30, k.stomata=10)
#> NULL