Skip to contents

statestats_means - convenient way to see STATE MEANS of ENVIRONMENTAL and RESIDENTIAL POPULATION indicators

Usage

statestats_means(
  ST = unique(EJAM::statestats$REGION),
  varnames = c(EJAM::names_e, EJAM::names_d, EJAM::names_d_subgroups_nh),
  PCTILES = "mean",
  dig = 4
)

Arguments

ST

vector of state abbreviations, or USA

varnames

names of columns in lookup table, like "proximity.rmp"

PCTILES

vector of percentiles 0-100 and/or "mean"

dig

digits to round to

Value

numeric matrix with one row per indicator in varnames and one column per state in ST (ST may contain repeats; columns follow the order of ST).

Examples

# \donttest{
# indicators as rows, one column per state
statestats_means(ST = c("MD", "VA"), varnames = EJAM::names_e[1:3])

# ST may repeat (e.g. one entry per site) - one column per element, values stay numeric
m <- statestats_means(ST = c("MD", "MD", "VA"), varnames = EJAM::names_e[1:3])
m[EJAM::names_e[1:3], ]
# }