corrr (version 0.4.0)

rplot: Plot a correlation data frame.

Description

Plot a correlation data frame using ggplot2.

Usage

rplot(rdf, legend = TRUE, shape = 16, colours = c("indianred2",
  "white", "skyblue1"), print_cor = FALSE, colors)

Arguments

rdf

Correlation data frame (see correlate) or object that can be coerced to one (see as_cordf).

legend

Boolean indicating whether a legend mapping the colors to the correlations should be displayed.

shape

geom_point aesthetic.

colours, colors

Vector of colors to use for n-color gradient.

print_cor

Boolean indicating whether the correlations should be printed over the shapes.

Value

Plots a correlation data frame

Examples

Run this code
# NOT RUN {
x <- correlate(mtcars)
rplot(x)

# Common use is following rearrange and shave
x <- rearrange(x, absolute = FALSE)
x <- shave(x)
rplot(x)
rplot(x, print_cor = TRUE)
rplot(x, shape = 20, colors = c("red", "green"), legend = TRUE)
# }

Run the code above in your browser using DataCamp Workspace