Skip to contents

Performs a non-parametric Mann-Kendall trend test on a time series variable. Uses Kendall's tau via stats::cor.test(method = "kendall").

Usage

mann_kendall_test(data, variable = "wave_height", time_col = "time")

Arguments

data

Data frame with time and value columns

variable

Name of the variable (default: "wave_height")

time_col

Name of the time column (default: "time")

Value

List with tau, p_value, and trend_direction ("increasing", "decreasing", or "no trend").

Examples

if (FALSE) { # \dontrun{
data <- data.frame(
  time = seq(as.POSIXct("2020-01-01"), by = "day", length.out = 365),
  wave_height = seq(2, 3, length.out = 365) + rnorm(365, 0, 0.2)
)
mann_kendall_test(data)
} # }