corPlot {Rarity} | R Documentation |
Correlation plots
Description
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.
Usage
corPlot(df, method = "spearman", digits = 2, na.action = "keep", ties.method = "average",
title = "", xlab = "variable.name", ylab = "variable.name", ...)
Arguments
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 |
Details
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.
Warning
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.
Author(s)
Boris Leroy leroy.boris@gmail.com
See Also
corrplot
in package arm
Examples
# 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")