trend_test | R Documentation |
Test for period of record and user-specified ranges. The default trends are calculated for 10 year and the full period of record.
trend_test(
gw_level_dv,
gwl_data,
n_years = 10,
parameter_cd = NA,
date_col = NA,
value_col = NA,
approved_col = NA,
stat_cd = NA,
pctComplete = 0.5,
days_required_per_month = 14,
POR_trend = TRUE
)
gw_level_dv |
daily groundwater level data frame. Often obtained from from |
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). |
n_years |
integer. This is the number of years to calculate the trend on. Default is 10. This can be a vector of years. |
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 |
date_col |
the heading of the date column. The default is |
value_col |
name of value column. The default is |
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. |
pctComplete |
number percentage complete. This is a fraction that represents the amount of data that must be included overall in order to calculate a trend. The default is 0.5, which means if gaps in the data span more than 50 total record, a trend will not be calculated. |
days_required_per_month |
integer. Number of days required per month to include in the trend test. Default is 14. |
POR_trend |
a logical indicating whether to include a trend test
for the full period of record. Default is |
For data that is at least on a daily interval, the rkt function is used. For periodic data, the kendallTrendTest is used.
a data frame of test results from 5 and 20 year Kendall Seasonal Trend test
# site <- "263819081585801"
# gw_level_data <- dataRetrieval::readNWISgwl(site)
# Using package example data:
gwl_data <- L2701_example_data$Discrete
gw_level_dv <- L2701_example_data$Daily
trend_test(gw_level_dv,
gwl_data,
parameter_cd = "62610")
trend_test(gw_level_dv,
gwl_data,
POR_trend = FALSE,
parameter_cd = "62610")
trend_test(gw_level_dv,
gwl_data,
parameter_cd = "62610",
n_years = 5)
trend_test(gw_level_dv,
gwl_data,
parameter_cd = "62610",
n_years = c(5, 10, 20))
# Only periodic data:
trend_test(NULL,
gwl_data,
parameter_cd = "62610")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.