View source: R/requery_cormat.R
rquery_cormat | R Documentation |
Calculate and easily visualize a correlation matrix. Function comes from Correlation matrix : An R function to do all you need
rquery_cormat(
x,
type = c("lower", "upper", "full", "flatten"),
graph = TRUE,
graphType = c("correlogram", "heatmap"),
col = NULL,
...
)
x |
matrix of data values |
type |
Possible values are “lower” (default), “upper”, “full” or “flatten”. It displays the lower or upper triangular of the matrix, full or flatten matrix. |
graph |
if TRUE, a correlogram or heatmap is generated to visualize the correlation matrix. |
graphType |
Type of graphs. Possible values are “correlogram” or “heatmap”. |
col |
colors to use for the correlogram or the heatmap. |
... |
Further arguments to be passed to cor() or cor.test() function. |
A list containing the following:
table of correlation coefficients
Table of p-values corresponding to the significance levels of the correlations
A representation of the correlation matrix in which coefficients are replaced by symbols according to the strength of the dependence
mydata <- mtcars[, c(1,3,4,5,6,7)]
head(mydata)
# Computing the correlation matrix
rquery_cormat(mydata)
# Upper triangle of the correlation matrix
rquery_cormat(mydata, type = "upper")
# Full correlation matrix
rquery_cormat(mydata, type = "full")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.