# Obtain the potential composite regions for each of the 5 stratification types
# Most useful if the user wishes to create an set of custom composite regions
#
# USGS BBS
st_comp_regions <- get_composite_regions(strata_type = "bbs_usgs")
# create new column "Great_Plains"
gpall <- rep("Outside",nrow(st_comp_regions))
gp <- which(st_comp_regions$bcr %in% c(11,17,18,19))
gpall[gp] <- "Inside"
st_comp_regions$Great_Plains <- gpall
# st_comp_regions can now be used as the dataframe input to the argument alt_region_names
# in generate_regional_indices,
# with "Great_Plains" as the value for the argument region
# CWS BBS
st_comp_regions <- get_composite_regions(strata_type = "bbs_cws")
# BCR
st_comp_regions <- get_composite_regions(strata_type = "bcr")
# State/Province/Territory
st_comp_regions <- get_composite_regions(strata_type = "state")
# Degree block
st_comp_regions <- get_composite_regions(strata_type = "latlong")
Run the code above in your browser using DataLab