sk_seasonal: Seasonal Kendall Analysis for Seasonal Data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sk_seasonal.R

Description

Non-parametric test for monotonic seasonal trends

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sk_seasonal(swmpr_in, ...)

## S3 method for class '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),
  ...
)

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.

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.

Value

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

Author(s)

Julie Padilla

See Also

assign_season, y_labeler, kendallSeasonalTrendTest

Examples

1
2
3
4
dat_wq <- elksmwq
dat_wq <- qaqc(dat_wq, qaqc_keep = c(0, 3, 5))

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

padilla410/SWMPrExtension documentation built on Dec. 29, 2021, 5:48 a.m.