1#' @templateVar class Kendall
2#' @template title_desc_tidy
3#'
4#' @param x A `Kendall` object returned from a call to [Kendall::Kendall()],
5#'   [Kendall::MannKendall()], or [Kendall::SeasonalMannKendall()].
6#' @template param_unused_dots
7#'
8#' @evalRd return_tidy(
9#'   "p.value",
10#'   "kendall_score",
11#'   "var_kendall_score",
12#'   statistic = "Kendall's tau statistic",
13#'   denominator = "The denominator, which is tau=kendall_score/denominator."
14#' )
15#'
16#' @examples
17#'
18#' if (requireNamespace("Kendall", quietly = TRUE)) {
19#'
20#' library(Kendall)
21#'
22#' A <- c(2.5, 2.5, 2.5, 2.5, 5, 6.5, 6.5, 10, 10, 10, 10, 10, 14, 14, 14, 16, 17)
23#' B <- c(1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2)
24#'
25#' f_res <- Kendall(A, B)
26#' tidy(f_res)
27#'
28#' s_res <- MannKendall(B)
29#' tidy(s_res)
30#'
31#' t_res <- SeasonalMannKendall(ts(A))
32#' tidy(t_res)
33#'
34#' }
35#'
36#' @export
37#' @seealso [tidy()], [Kendall::Kendall()], [Kendall::MannKendall()],
38#'   [Kendall::SeasonalMannKendall()]
39#' @aliases Kendall_tidiers kendall_tidiers
40#'
41tidy.Kendall <- function(x, ...) {
42  col_names <- c(
43    "statistic",
44    "p.value",
45    "kendall_score",
46    "denominator",
47    "var_kendall_score"
48  )
49  ret <- as_tibble(unclass(x))
50  set_names(ret, col_names)
51}
52