Learn R Programming

SWMPrExtension (version 2.2.5.1)

sk_seasonal: Seasonal Kendall Analysis for Seasonal Data

Description

Non-parametric test for monotonic seasonal trends

Usage

sk_seasonal(swmpr_in, ...)

# S3 method for swmpr sk_seasonal( swmpr_in, param = NULL, alpha = 0.05, data_min = 5, envStats_summary = FALSE, stat_lab = "Average", FUN = function(x) mean(x, na.rm = TRUE), ... )

Value

Returns a data.frame object or a summary from EnvStats::kendallSeasonalTrendTest

Arguments

swmpr_in

input swmpr object

...

additional arguments passed to other methods. See assign_season

param

chr string of variable to plot

alpha

num, alpha value to use to significance test. Defaults to 0.05.

data_min

num, the minimum number of observations required to perform the analysis. Defaults to 5

envStats_summary

logical, should the standard EnvStats::kendallSeasonalTrendTest be returned? Defaults to FALSE. See Details for more information.

stat_lab

chr, label for the summary statistic defined in FUN. Defaults to "Average".

FUN

function used to aggregate seasonal SWMP data.

Author

Julie Padilla

Details

This function performs a seasonal kendall test on seasonally aggregated values using kendallSeasonalTrendTest.

Data are aggregated on a user-specified seasonal basis using the FUN argument. For example, using default settings, sk_seasonal would perform a seasonal kendall test on average monthly values. However, if the user set FUN = min(x, na.rm = TRUE) then a seasonal kendall would be performed on monthly minimum values.

If EnvStats_summary = TRUE then the detailed output summary from kendallSeasonalTrendTest will be returned. If EnvStats_summary = FALSE then an abbreviated summary will be returned in a data.frame. The abbreviated summary contains the station name, the type of statistic used to summarize the data on a seasonal basis (specified by stat_lab), and the following results from kendallSeasonalTrendTest: tau, slope, p-value for the chi-square test, and the p-value for the trend test.

See Also

assign_season, y_labeler, kendallSeasonalTrendTest

Examples

Run this code
dat_wq <- elksmwq
dat_wq <- qaqc(dat_wq, qaqc_keep = c(0, 3, 5))

x <- sk_seasonal(dat_wq, param = 'temp')

Run the code above in your browser using DataLab