preproc_audit_data function

Audit daily data for total days in year

Audit daily data for total days in year

Audit daily data for total days in year. An audit is performed to inventory and flag missing days in daily data and help determine if further analyses are appropriate.

preproc_audit_data( data = NULL, Date, value, year_group, use_specific_years = FALSE, begin_year = NULL, end_year = NULL, days_cutoff = 360, date_format = "%Y-%m-%d" )

Arguments

  • data: 'data.frame'. Optional data.frame input, with columns containing Date and value. Column names are specified as strings in the corresponding parameter. Default is NULL.

  • Date: 'Date' or 'character' vector when data = NULL, or 'character' string identifying Date column name when data is specified. Dates associated with each value in value parameter.

  • value: 'numeric' vector when data = NULL, or 'character' string identifying year column name when data is specified. Values to audit, must be daily data.

  • year_group: 'numeric' vector when data = NULL, or 'character' string identifying grouping column name when data is specified. Year grouping for each daily value in value

    parameter. Must be same length as value.

  • use_specific_years: 'boolean' value. Flag to clip data to a certain set of years in year_group. Default is FALSE.

  • begin_year: 'numeric' value. If use_specific_years = TRUE, beginning year to clip value. Default is NULL.

  • end_year: 'numeric' value. If use_specific_years = TRUE, ending year to clip value. Default is NULL.

  • days_cutoff: 'numeric' value. Designating the number of days required for a year to be counted as full. Default is 360.

  • date_format: 'character' string. Format of Date. Default is "%Y-%m-%d".

Returns

A data.frame with year_group, count (n, excluding NA values) of days in each year_group, and a complete years 'boolean' flag.

Details

Year grouping is commonly water year, climate year, or calendar year.

Examples

preproc_audit_data( data = example_preproc, Date = "Date", value = "value", year_group = "WY" )

See Also

preproc_fill_daily, preproc_precondition_data

  • Maintainer: Colin Penn
  • License: CC0
  • Last published: 2024-08-28