R/korrelation.R

Defines functions cor_kendall cor_spearman cor_pearson

Documented in cor_kendall cor_pearson cor_spearman

#' Correlation coefficients
#'
#' Wrapper to [stats::cor].
#'
#' @param x,y Vectors.
#'
#' @name correlation_coefficients
NULL

#' @rdname correlation_coefficients
#'
#' @export
cor_pearson <- function(x, y) {
  cor(x, y, method = "pearson")
}

#' @rdname correlation_coefficients
#'
#' @export
cor_spearman <- function(x, y) {
  cor(x, y, method = "spearman")
}

#' @rdname correlation_coefficients
#'
#' @export
cor_kendall <- function(x, y) {
  cor(x, y, method = "kendall")
}
DavidBarke/Stat1-Functions documentation built on Feb. 25, 2021, 2:56 p.m.