View source: R/correlation_plots.R
| corPlot | R Documentation |
Produces a scatter plot with the distribution of points according to the tested variables in the lower left triangle and the correlation values in the upper left triangle.
corPlot(df, method = "spearman", digits = 2, na.action = "keep", ties.method = "average",
title = "", xlab = "variable.name", ylab = "variable.name", ...)
df |
a matrix or a data.frame. The values of variables (e.g., indices) to be compared are in columns. |
method |
|
digits |
Number of digits to round the correlation values on the plot. |
na.action |
for controlling the treatment of NAs in |
ties.method |
|
title |
Title of the plot. |
xlab |
a character string for labelling x axes. |
ylab |
a character string for labelling y axes. |
... |
Further arguments to be passed to the individual plots. See |
The lower half shows the scatter plots of values or ranks of variables. The upper half shows the corresponding correlation coefficients (significativity: 0 '***' 0.001 '**' 0.01 '*' 0.05 '-' 0.1 ' ' 1). The diagonal shows the considered variables and the number of individuals available for each.
If the chosen method is pearson, then the actual values of the variables will be plotted. If the chosen method is a rank-based method, spearman or kendall, then the ranks will be plotted.
A high number of variables will likely result in a slow generation of plots and a poor readability. Above 10 variables, the readability is greatly reduced.
Boris Leroy leroy.boris@gmail.com
corrplot in package arm
# Comparisons of species occurrences estimated from 2 different scales
data(spid.occ)
corPlot(spid.occ, method = "pearson")
# Another example:
# Correlation between different variables measured on the same individuals
data(iris)
corPlot(iris[, 1:4], method = "pearson")
corPlot(iris[, 1:4], method = "spearman")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.