daily_frequency_table: Daily frequency table

View source: R/frequency_analysis.R

daily_frequency_tableR Documentation

Daily frequency table

Description

Calculates the historical max, mean, minimum, and number of available points for each day of the year

Usage

daily_frequency_table(
  gw_level_dv,
  gwl_data,
  parameter_cd = NA,
  date_col = NA,
  value_col = NA,
  approved_col = NA,
  stat_cd = NA
)

Arguments

gw_level_dv

data frame, daily groundwater level data from readNWISdv

gwl_data

data frame returned from dataRetrieval::readNWISgwl, or data frame with mandatory columns lev_dt (representing date), lev_age_cd (representing approval code), and a column representing the measured value (either lev_va, sl_lev_va, or value).

parameter_cd

If data in gw_level_dv comes from NWIS, the parameter_cd can be used to define the value_col. If the data doesn't come directly from NWIS services, this can be set to NA,and this argument will be ignored.

date_col

the heading of the date column. The default is NA, which the code will try to get the column name automatically.

value_col

name of value column. The default is NA, which the code will try to get the column name automatically.

approved_col

name of column to get provisional/approved status.

stat_cd

If data in gw_level_dv comes from NWIS, the stat_cd can be used to help define the value_col.

Value

a data frame giving the max, mean, min, and number of available days of data for each day of the year.

Examples


# site <- "263819081585801"
p_code_dv <- "62610"
statCd <- "00001"
# gw_level_dv <- dataRetrieval::readNWISdv(site, p_code_dv, statCd = statCd)
gw_level_dv <- L2701_example_data$Daily
daily_frequency_table(gw_level_dv,
                      NULL,
                      parameter_cd = "62610")

gwl_data <- L2701_example_data$Discrete
daily_frequency_table(gw_level_dv,
                      gwl_data,
                      parameter_cd = "62610")

USGS-R/HASP documentation built on July 28, 2024, 7:53 a.m.