Plot a correlation data frame.Source:
Plot a correlation data frame using ggplot2.
Boolean indicating whether a legend mapping the colors to the correlations should be displayed.
- colours, colors
Vector of colors to use for n-color gradient.
Boolean indicating whether the correlations should be printed over the shapes.
Either "default", meaning x and y variables keep the same order as the columns in
x, or "alphabet", meaning the variables are alphabetized.
Each value in the correlation data frame is represented by one point/circle
in the output plot. The size of each point corresponds to the absolute value
of the correlation (via the
size aesthetic). The color of each point
corresponds to the signed value of the correlation (via the
x <- correlate(mtcars) #> Correlation computed with #> • Method: 'pearson' #> • Missing treated using: 'pairwise.complete.obs' 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)