network_plot: Network plot of a correlation data frame

Description Usage Arguments Examples

Description

Output a network plot of a correlation data frame in which variables that are more highly correlated appear closer together and are joined by stronger paths. Paths are also coloured by their sign (blue for positive and red for negative). The proximity of the points are determined using multidimensional clustering.

Usage

1
2
3
network_plot(rdf, min_cor = 0.3, legend = TRUE,
  colours = c("indianred2", "white", "skyblue1"), repel = TRUE,
  curved = TRUE, colors)

Arguments

rdf

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

min_cor

Number from 0 to 1 indicating the minimum value of correlations (in absolute terms) to plot.

legend

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

colours, colors

Vector of colours to use for n-colour gradient.

repel

Should variable labels repel each other? If TRUE, text is added via geom_text_repel instead of geom_text

curved

Should the paths be curved? If TRUE, paths are added via geom_curve; if FALSE, via geom_segment

Examples

1
2
3
4
5
x <- correlate(mtcars)
network_plot(x)
network_plot(x, min_cor = .1)
network_plot(x, min_cor = .6)
network_plot(x, min_cor = .7, colors = c("red", "green"), legend = TRUE)

drsimonj/corrr documentation built on May 15, 2019, 2:52 p.m.