grouped_random_sample: Grouped Random Sample

View source: R/grouped_random_sample.R

grouped_random_sampleR Documentation

Grouped Random Sample

Description

Take a simple random sample by a group

Usage

grouped_random_sample(
  data = NA,
  group_name = "strata",
  n = 20,
  stream_order = "STREAM_ORDER"
)

Arguments

data

A data object of class sf.

group_name

String. Column name for the strata to sample across. It is assumed that group_name is strata and the values are stratum_1 for stream segments less than 3rd order and stratum_2 for stream segments 3rd order and greater.

n

Sample size n for each stratum

stream_order

Column name for stream order. Defaults to STREAM_ORDER.

Details

Note that there is no repeat sampling or replacement. If the sample size n exceeds the number of stream crossings in a stratum, then only the limited number of available crossings will be returned. Stream order should be labelled as STREAM_ORDER.

Value

A object of class sf of sample features.


essatech/wsep.t2 documentation built on Sept. 3, 2022, 5:56 a.m.