Description Usage Arguments Value Examples
Produces a simple correlation matrix table.
1 |
data |
data.frame containing the variables for which the correlation matrix should be calculated. |
use |
Which observations should be used? use="pairwise" is the default value and will do pairwise deletion of cases. use="complete" will select just complete cases. |
method |
Which correlation type should be used? method="pearson" is the default value. The alternatives to be passed to cor are "spearman" and "kendall". |
round |
numeric values that denotes to what decimal point should be rounded. |
significance |
character vector that specifies if p-values and/or significance stars should be included in the table. ="NA" displays no significances. ="stars" displays significance stars. ="p-values" displays p-values and =c("stars", "p-values") displays both stars and p-values. |
sd |
logical value that toggles Whether the standard deviation should be displayed in the diagonal. |
mean.sd.cols |
logical value that toggles Whether additional mean and standard columns should be included in the table. |
A dataframe comprising the correlation matrix table.
1 2 3 4 5 6 7 8 9 10 11 12 | data(myData)
corTable(myData[,1:4])
corTable(myData[,1:4], method = "kendall")
corTable(myData[,1:4], sd = TRUE)
corTable(myData[,1:4], use = "complete")
corTable(myData[,1:4], significance = "stars")
corTable(myData[,1:4], significance = c("stars", "p-values"))
corTable(myData[,1:4], round = 4)
corTable(myData[,1:4], mean.sd.cols = TRUE)
(cor.tab <- corTable(myData[,1:4], significance = "stars", mean.sd.cols = TRUE))
#saveTable(cor.tab, "corTab.rtf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.