plotCor: Plot a Correlation Matrix

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Plot a correlation matrix with scatterplots, correlation coefficients and colors.

Usage

1
2
3
plotCor(tab,
        method = c("pearson", "kendall", "spearman"),
        formatCor, colCor, ...)

Arguments

tab

a dataframe. Contain the variable whose correlation is of interest.

method

among pearson, kendall and spearman. Method used to compute the correlation coefficient.

formatCor

a function. Applied to a htest object and returning a character string, formats the display of the correlation coefficient.

colCor

a function. Applied to a htest object and returning a color (character string or rgb).

...

additional arguments passed to formatCor.

Details

Displays a matrix plot where the diagonal contains the variable names, the lower triangle displays scatterplots between the variables and the upper triangle correlation coefficients with colors corresponding the the magnitude of the correlation.

Value

Nothing of interest.

Author(s)

Antoine Filipovic Pierucci

See Also

cor.test.

Examples

1
2
3
4
5
x <- iris[, 1:4]
plotCor(x)

plotCor(x, formatCor = function(x) round(x$estimate, 2))
plotCor(x, colCor = function(x) if (x$estimate > 0) "green" else "yellow")


Search within the rmngb package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.