spatial_bg_avg: spatial_bg_avg

View source: R/spatial_bg_avg.R

spatial_bg_avgR Documentation

spatial_bg_avg

Description

Find the spatial block group average, weighting each receptor by its spatial coverage of the block group.

Usage

spatial_bg_avg(
  data = NULL,
  result_cols = c("resident_cancer", "resident_hazard", "inhalation_cancer",
    "inhalation_hazard", "acute_hazard", "annual_concentration", "acute_concentration"),
  receptor_col = "receptor",
  pollutant_col = "pollutant",
  year = 2017,
  counties = NULL,
  bg_geoids = NULL,
  signif_digits = 3
)

Arguments

data

Data frame containing modeling results for averaging.

result_cols

Column names containing the modeling concentration/risk results.

receptor_col

Receptor column name with receptor ID numbers.

pollutant_col

Pollutant colulmn name for grouping results.

year

The MNRISKS results year. Default value is 2017.

counties

5 digit County FIPs codes to return results for, e.g. 27053, 27137. Default returns only the counties included in the data receptor column. "All" will return all MN Counties.

bg_geoids

Census block group geoid numbers to include in results. Default returns all block groups.

signif_digits

Number of significant figures to keep in calculated results.

Examples

## Not run: 
# For all block groups
bg_avg <- spatial_bg_avg(values    = df$resident_cancer, 
                         receptors = df$receptor,
                         bg_geoids = df$geoid)

## End(Not run)

MPCA-air/mnrisks documentation built on March 21, 2023, 4:24 a.m.