Performs the Mann-Kendall trend test. This function is a wrapper around mk.test. See documentation there for more details about the calculation

mann_kendall(
  x,
  alternative = c("greater", "two.sided", "less"),
  continuity = TRUE
)

Arguments

x

a vector of class "numeric" or a time series object of class "ts"

alternative

the alternative hypothesis, defaults to two.sided

continuity

logical, indicates whether a continuity correction should be applied, defaults to TRUE.

Value

a tidy data frame with the test results

Examples

x <- runif(100) * 1:100 mann_kendall(x, alternative = "two.sided")
#> # A tibble: 1 × 9 #> p_value s var_s tau z method n alternative note #> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <int> <chr> <chr> #> 1 2.76e-14 2556 112750 0.516 7.61 Mann-Kendall 100 two.sided NA