Learn R Programming

imageData (version 0.1-21)

corrPlot: Calculates and plots correlation matrices for a set of responses

Description

Having calculated the correlations a heat map indicating the magnitude of the correlations is produced using ggplot. In this heat map, the darker the red in a cell then the closer the correlation is to -1, while the deeper the blue in the cell, then the closer the correlation is to 1. Also produced is a matrix plot of all pairwise combinations of the variables. The matrix plot contains a scatter diagram for each pair, as well as the value of the correlation coefficient. The argument pairs.sets can be used to restrict the pairs in the matrix plot to those combinations within each set.

Usage

corrPlot(responses, data, show.sig = FALSE, title = NULL, pairs.sets = NULL, labelSize = 4, ...)

Arguments

responses
A character giving the names of the columns in data containing the variables to be correlated.
data
A data.frame containing the columns of variables to be correlated.
show.sig
A logical indicating whether or not to give asterisks indicating significanc on the plot.
title
Title for the plot.
pairs.sets
A list each of whose components is a numeric giving the position of the variable names in responses that are to be included in the set. All pairs of variables in this pairs.set will be included in a matrix plot.
labelSize
A numeric giving the size of the labels in the matrix plot.
...
allows passing of arguments to other functions

Value

ggplot", which can be plotted using print.

See Also

ggplot.

Examples

Run this code
data(exampleData)
responses <- c("Area","Area.SV","Area.TV", "Image.Biomass", "Max.Height","Centre.Mass",
               "Density", "Compactness.TV", "Compactness.SV")
corrPlot(responses, longi.dat, pairs.sets=list(c(1:4),c(5:7)))

Run the code above in your browser using DataLab