organize_stad: Combine and/or Pivot STAD Data Set(s)

Description Usage Arguments Value See Also Examples

View source: R/organize_stad.R

Description

Choose to combine multiple STAD data sets, and/or pivot columns. Useful for combining FRM and PA data frames, or pivoting columns of the same pollutant type.

Usage

1
2
3
4
5
6
7
organize_stad(
  dataset,
  measurements,
  col_rename,
  keep_cols = FALSE,
  drop_missing = TRUE
)

Arguments

dataset

Dataset(s) to pivot. If more than one data set is provided, they will be row-bound. Use list() if more than one.

measurements

Character, optional. Column headers to pivot. Use c().

col_rename

Character, optional, only run if measurements provided. The character to rename the 'value' column output of the pivot to.

keep_cols

Logical, only run if measurements provided. Keep (TRUE) or disgard (FALSE) the non-identifying columns that have not been pivoted.

drop_missing

Logical, only run if measurements provided. Drop missing values from pivoted column. Recommended especially if keep_cols is FALSE.

Value

Data set.

See Also

filter_df()

Other miscellaneous functions: adjust_timezone(), ambient_temperature(), apply_date_tags(), apply_hour_tags(), column_dt(), filter_df(), group_stad(), rounding_w_zeroes(), unit_convert(), wrangle_meta()

Examples

1
2
3
4
5
6
# Pivot columns of a similar pollutant:
head(organize_stad(july_api_daily, c(pm25_epa_2021, pm25_epa_2020, pm25_lrapa), "pm25"))
# Combine PA and FRM data:
head(organize_stad(list(july_api_daily, july_frm_daily), c(pm25_epa_2021, pm25_frm)))
# Combine meta data:
tail(organize_stad(list(july_api_meta, july_frm_meta)))

gmcginnis/AirVizR documentation built on Dec. 20, 2021, 11:49 a.m.