dia_histogram: Histograms and frequency polygons for ggcorrm plots

Description Usage Arguments Details Value See Also

View source: R/add_dia_funs.R

Description

Add histograms or frequency polygons to the diagonal panels of ggcorrm plots

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dia_histogram(
  mapping = NULL,
  lower = 0.3,
  upper = 0.98,
  bins = 10,
  position = "identity",
  ...
)

dia_freqpoly(mapping = NULL, lower = 0.3, upper = 0.98, bins = 15, ...)

Arguments

mapping

Set of aesthetic mappings created by aes. x and y are set automatically and must not be changed, but all other aesthetics may be manipulated. Defaults to NULL (use standard ggcorrm mapping).

lower

numeric between 0 and 1. Lower limit of the histograms/frequency polygons relative to the range of the y axis. Defaults to 0.25.

upper

numeric between 0 and 1. Upper limit of the histograms/frequency polygons relative to the range of the y axis. Defaults to 1.

bins

Number of bins. Overridden by binwidth. Defaults to 30.

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

...

Additional parameters for stat_dia_bin().

Details

The lower andupper arguments can be used to offset the histograms/frequency polygons from zero and optimally fit them to the range of each panel. The standard values are chosen to work well when placing text labels under the histograms/frequency polygons with dia_names().

dia_histogram() adds histograms of the numeric variables in a ggcorrm plot to the plot diagonal. Frequency polygons can be created with dia_freqpoly(). Both functions use the same stat, stat_dia_bin(), which is built upon ggplot2::stat_bin().

Value

A ggplot2 layer with histograms or frequency polygons for the variables on the plot diagonal of ggcorrm plots.

See Also

ggplot2::stat_bin(), stat_dia_bin()


r-link/corrmorant documentation built on Jan. 10, 2021, 7:26 p.m.