View source: R/correlationMatrix.R
cor.table | R Documentation |
Function that creates a correlation matrix similar to SPSS output.
cor.table(x, y, type = "none", dig = 2, correlation = "pearson")
x |
Variable or set of variables in the form of a vector or dataframe
to correlate with |
y |
(optional) Variable or set of variables in the form of a vector or
dataframe to correlate with |
type |
Type of correlation matrix to print. One of:
|
dig |
Number of decimals to print. |
correlation |
Method for calculating the association. One of:
|
Co-created by Angela Staples (astaples@emich.edu) and Isaac Petersen (isaac-t-petersen@uiowa.edu). For a partial correlation matrix, see partialcor.table.
A correlation matrix.
Other correlations:
addText()
,
crossTimeCorrelation()
,
crossTimeCorrelationDF()
,
partialcor.table()
,
vwReg()
# Prepare Data
data("mtcars")
# Correlation Matrix
cor.table(mtcars[,c("mpg","cyl","disp")])
cor.table(mtcars[,c("mpg","cyl","disp")])
cor.table(mtcars[,c("mpg","cyl","disp")], dig = 3)
cor.table(mtcars[,c("mpg","cyl","disp")], dig = 3, correlation = "spearman")
cor.table(mtcars[,c("mpg","cyl","disp")], type = "manuscript", dig = 3)
cor.table(mtcars[,c("mpg","cyl","disp")], type = "manuscriptBig")
table1 <- cor.table(mtcars[,c("mpg","cyl","disp")], type = "latex")
table2 <- cor.table(mtcars[,c("mpg","cyl","disp")], type = "latexSPSS")
table3 <- cor.table(mtcars[,c("mpg","cyl","disp")], type = "manuscriptLatex")
table4 <- cor.table(mtcars[,c("mpg","cyl","disp")], type = "manuscriptBigLatex")
cor.table(mtcars[,c("mpg","cyl","disp")], mtcars[,c("drat","qsec")])
cor.table(mtcars[,c("mpg","cyl","disp")], mtcars[,c("drat","qsec")], type = "manuscript", dig = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.