powered by
Efficiently fit correlation coefficient for matrix or two vectors
corr(x, y = NULL, spearman = FALSE)
a numeric vector, the correlation coefficient
a matrix or vector
a vector. Optional.
Logical. Use Spearman's correlation?
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