allocate_panels: Create a design object programmatically to use with...

View source: R/panels.r

allocate_panelsR Documentation

Create a design object programmatically to use with spsurvey::grts().

Description

Creates a structured list that meets the requirements for a design object for spsurvey::grts() (prior to v5.3.0) distributing points proportionally to strata based on their relative areas/abundances.

Usage

allocate_panels(
  polygons,
  stratum_field = "stratum",
  panel_names = c("1", "2", "3", "4", "5"),
  panel_sample_size = 50,
  points_min = 3,
  oversample_proportion = 0.25,
  oversample_min = 3
)

Arguments

polygons

Polygon sf object. The polygons describing the strata boundaries. Must contain a variable containing the stratum identities.

stratum_field

A character string of the name of the variable in points containing the stratum identities of the polygons. Defaults to "stratum".

panel_names

A character vector of the names to assign to the panels. All values must be unique. This must be the same length and in the same order as panel_sample_size. Defaults to c("1", "2", "3", "4", "5").

panel_sample_size

A numeric vector of the number of base points to be drawn in each panel. This must be the same length and in the same order as panel_names UNLESS all panels have the same number of base points in which case panel_sample_size optionally may be a single numeric value despite panel_names containing more than one value. Defaults to c(50).

points_min

A numeric value of the minimum number of base points to allocate to a stratum within a panel regardless of its relative size. Defaults to 3.

oversample_proportion

A numeric value between 0 and 1 representing the minimum relative proportion of oversample points to allocate per stratum per panel using the formula panel_sample_size * min.oversample_proportion. Defaults to 0.25.

oversample_min

A numeric value representing the minimum number of oversample points to allocate per stratum per panel. This is only used if it is greater than panel_sample_size * min.oversample_proportion. Defaults to 3.

Value

A named list of named lists conforming to the requirements for the design object for spsurvey::grts().


nstauffer/sample.design documentation built on May 9, 2022, 3:21 a.m.