Daily frequency table
daily_frequency_table.Rd
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")
#> # A tibble: 366 × 5
#> DOY max mean min points
#> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 1 -5.29 -22.5 -41.4 41
#> 2 2 -5.24 -22.5 -40.1 41
#> 3 3 -5.3 -22.6 -40.2 41
#> 4 4 -5.55 -22.6 -41.6 41
#> 5 5 -5.48 -22.7 -40.5 41
#> 6 6 -5.71 -22.7 -40.6 41
#> 7 7 -5.64 -22.8 -42.2 41
#> 8 8 -5.75 -22.7 -41.4 41
#> 9 9 -5.52 -22.5 -40.5 42
#> 10 10 -5.3 -22.6 -40.6 42
#> # ℹ 356 more rows
gwl_data <- L2701_example_data$Discrete
daily_frequency_table(gw_level_dv,
gwl_data,
parameter_cd = "62610")
#> # A tibble: 366 × 5
#> DOY max mean min points
#> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 1 -5.29 -22.5 -41.4 41
#> 2 2 -5.24 -22.5 -40.1 41
#> 3 3 -5.3 -22.6 -40.2 41
#> 4 4 -5.55 -22.6 -41.6 41
#> 5 5 -5.48 -23.0 -40.5 43
#> 6 6 -5.71 -22.7 -40.6 41
#> 7 7 -5.64 -22.8 -42.2 41
#> 8 8 -5.75 -22.6 -41.4 42
#> 9 9 -5.52 -22.5 -40.5 43
#> 10 10 -5.3 -22.6 -40.6 42
#> # ℹ 356 more rows