partition (version 0.1.0)

corr: Efficiently fit correlation coefficient for matrix or two vectors

Description

Efficiently fit correlation coefficient for matrix or two vectors

Usage

corr(x, y = NULL, spearman = FALSE)

Arguments

x

a matrix or vector

y

a vector. Optional.

spearman

Logical. Use Spearman's correlation?

Value

a numeric vector, the correlation coefficient

Examples

Run this code
# NOT RUN {
library(dplyr)
# fit for entire data set
iris %>%
  select_if(is.numeric) %>%
  corr()

# just fit for two vectors
corr(iris$Sepal.Length, iris$Sepal.Width)

# }

Run the code above in your browser using DataLab