Skip to contents

Merges private well percentage data into probability or concentration datasets.

Usage

add_well_percentages(
  target_data,
  well_data,
  target_id_col = "GEOID10",
  well_id_col = "GEOID",
  well_pct_col = "private_well_pct",
  output_col = "PWELL_private_pct"
)

Arguments

target_data

A data.table or data frame to add well percentages to.

well_data

A data frame containing private well percentages by geographic unit.

target_id_col

Character. Column name for geographic ID in target_data. Default is "GEOID10".

well_id_col

Character. Column name for geographic ID in well_data. Default is "GEOID".

well_pct_col

Character. Column name for private well percentage. Default is "private_well_pct".

output_col

Character. Name for the output column. Default is "PWELL_private_pct".

Value

The target_data with an added column for private well percentage.

Examples

if (FALSE) { # \dontrun{
# Add well percentages to concentration data
census_wells <- data.frame(
  GEOID = c("06001", "06003"),
  private_well_pct = c(15.2, 28.7)
)

conc_with_wells <- add_well_percentages(
  target_data = conc_data,
  well_data = census_wells,
  well_pct_col = "private_well_pct"
)
} # }