Grow a patch of cells

grow_connected_region(
  cells,
  nb,
  seed = NULL,
  existing.patch = NULL,
  blacklisted_cells
)

Arguments

cells

sf object of all cells, with edge cells removed.

nb

Object of class "nb", created from the 'spdep' function poly2nb().

seed

Numeric. Index of first cell in patch (the 'seed' cell). Defaults to NULL.

existing.patch

Numeric. Indices of cells in the patch which is to be 'grown'. Defaults to NULL.

blacklisted_cells

Numeric. Indices of cells to exclude (e.g. the subsidiary cell of a stomatal complex that is cut off by the image edge).

Value

A numeric vector containing the indices of the sampled polygons