trrrends: trrrends

View source: R/trrrends.R

trrrendsR Documentation

trrrends

Usage

trrrends(
  x,
  conf_level = 0.95,
  alt_hypo = c("two-tailed", "greater", "less"),
  continuity = TRUE,
  na = c("rm", "drop", "approx", "lm", "fill", "extend", "aggregate", "mean", "median",
    "min", "max", "fail")
)

Arguments

x

Timeseries vector.

conf_level

Confidence level used for calculating the upper and lower bounds of the Sen-Theil slope estimator. Defaults to 95

\item

alt_hypoAlternative hypothesis applied in the Mann-Kendall S statistic.

\item

continuityLogical whether to apply continuity correction to Mann-Kendall statistics. Same correction is always applied to Sen-Theil slope estimation.

\item

naMethod reference for handling missing values. Missing values are dropped by default, but can also be replaced using a linear approximation, the nearest value, or a summary statistic (mean, median, min, max).

Dataframe of all relevant trend statistics from the Sen-Theil, Mann-Kendall, and Kendall families of statistics. Applies a family of trend statistics: The Mann-Kendall S statistic, the Sen-Theil slope estimator, and Kendall's tau. ## Not run: dummy <- tibble::tibble(YEAR = c(2000:2020)) %>% dplyr::rowwise() %>% dplyr::mutate(RANDOM = runif(1, -33, 100)) %>% dplyr::ungroup() %>% dplyr::mutate(GRP = 'GROUP A') %>% dplyr::bind_rows(tibble::tibble(YEAR = c(2005:2020)) %>% dplyr::rowwise() %>% dplyr::mutate(RANDOM = runif(1, 33, 100)) %>% dplyr::ungroup() %>% dplyr::mutate(GRP = 'GROUP B')) %>% dplyr::bind_rows(tibble::tibble(YEAR = c(2000:2020)) %>% dplyr::rowwise() %>% dplyr::mutate(RANDOM = runif(1, 0, 1)) %>% dplyr::ungroup() %>% dplyr::mutate(GRP = 'GROUP C')) dummy %>% dplyr::group_by(GRP) %>% dplyr::mutate(RANDOM = ifelse(RANDOM >= 80, NA, RANDOM)) %>% dplyr::summarise(trrrends(RANDOM, conf_level = 0.95, alt_hypo = 'two-tailed', continuity = TRUE, na = 'median')) ## End(Not run)


toddellis/miao documentation built on June 1, 2025, 10:11 p.m.