plotCor | R Documentation |
plotCor
creates a matrix of bivariate correlation plots between
all/selected pairs
of variables in a data frame, similarly to
plot.data.frame
. On the diagonal, there are histograms of
individual variables colored, by default,according to the estimated
normality of those variables. Below (or above) the diagonal, there
are scatter plots enriched by smoothed conditional estimates of the
mean, and, optionally, a linear fit. Above (or below) the diagonal,
there are estimates of the correlation coefficients and their
significances shown.
plotCor
is based on / inspired by several other similar plots.
I thank their authors, but, unfortunatelly, can't give credits to
them, as I can't remember all of them.
plotCor(x, method = c("pearson",
"spearman", "spearmanExact",
"glmPoisson", "lm"),
adjust = FALSE, i1 = NULL,
i2 = NULL, normalityColor = TRUE,
aboveDiag = FALSE,
silent = FALSE, plot = TRUE,
lmFit = TRUE, ...)
x |
data frame |
method |
|
adjust |
|
i1 |
optional vector of indices or names of column of 'x' that
form first elements of correlation |
i2 |
optional vector of indices or names of column of 'x' that
form second elements of correlation |
normalityColor |
If TRUE, the diagonal histograms of individual variables get colored according to the estimated normality of the variables (normality in 'green', non-normality in 'red', indeterminate normality in 'gray'). |
aboveDiag |
If TRUE, scatter plots will appear above the diagonal and decorations below the diagonal. If FALSE (the default), scatter plots will appear below the diagonal and decorations above the diagonal. |
silent |
if TRUE, the number of tests compenstaing for gets displayed |
plot |
if TRUE, a |
lmFit |
add a linear fit to smooth |
... |
further arguments passed on to 'pairs' |
the estimated effective number of the tests performed
Tomas Sieger
#
plotCor(iris[,1:4])
plotCor(iris[,1:4],i1=c('Sepal.Length','Sepal.Width'),i2=c('Petal.Length','Petal.Width'))
plotCor(iris[,1:4],adjust='full')
# TODO: demonstrate more features
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.