nwos_stratum_area_replicates: NWOS Stratum Areas for Replicates

View source: R/nwos_stratum_area_replicates.R

nwos_stratum_area_replicatesR Documentation

NWOS Stratum Areas for Replicates

Description

This function estimates NWOS stratum areas for NWOS replicates and is designed to be used with an apply function, such as sapply.

Usage

nwos_stratum_area_apply(index.rep, index, stratum, state.area)

Arguments

index.rep

list of observations (i.e., replicates) to include.

index

vector used to identify the location of values in the other vectors (e.g., row names).

stratum

vector indicating inclusion (1) and exclusion (0) in the stratum of interest.

state.area

total land area in the state of interest.

Details

point.count in nwos_stratum_area is set to 1 since the replicates are an expanded list (one observation per sample point).

Value

Area of forestland in the stratum.

References

Butler, B.J. In review. Weighting for the US Forest Service, National Woodland Owner Survey. U.S. Department of Agriculture, Forest Service, Northern Research Station. Newotwn Square, PA.

Examples

wi <- tbl_df(read.csv("data/wi.csv")) %>% mutate(ROW_NAME = row.names(wi), AC_WOOD = ACRES_FOREST, FFO = if_else(LAND_USE == 1 & OWN_CD == 45 & AC_WOOD >= 1, 1, 0))
WI_REPLICATES <- nwos_replicates(index = row.names(wi), point.count = wi$POINT_COUNT, R = 100)
WI_FFO_AREA_REP <- sapply(WI_REPLICATES, nwos_stratum_area_apply, index = wi$ROW_NAME, stratum = wi$FFO, state.area = 33898733)
WI_FFO_AREA_REP

familyforestresearchcenter/nwos documentation built on April 12, 2025, 11:54 a.m.