correlation: Correlation test

Description Usage Arguments Details Value Examples

View source: R/general.R

Description

This function computes the correlation between x and y given both are numeric vectors, between the columns of x if it is a numeric matrix, or between the columns of x and y if both are numeric matrixes

Usage

1
2
correlation(x, y = NULL, method = c("pearson", "spearman", "kendall"),
  pairwise = FALSE)

Arguments

x

Numeric vector or matrix

y

Optional numeric vector or matrix

method

Character string indicating the correlation method

pairwise

Logical, wether columns of x and y should be compared in a pairwise manner. x and y must have the same number of columns

Details

This function computes correlation and associated p-values

Value

Numeric value, vector or matrix of results

Examples

1
2
3
x <- seq(0, 10, length=50)
y <- x+rnorm(length(x), sd=2)
correlation(x, y)

diggit documentation built on Nov. 8, 2020, 8:18 p.m.