relativeHistogram: Produce a relative histogram

Description Usage Arguments Value See Also Examples

View source: R/relativeHistogram.R

Description

relativeHistogram() produces a relative histogram based on the contents of the input data frame, which must be a mt_univariateSummary object.

Usage

1
relativeHistogram(data, xLabel, barColor = "#BDDFF7")

Arguments

data

mt_univariateSummary data frame

xLabel

character string; x variable label

barColor

character string; fill color for bars (valid color)

Value

A plot_ly visualization of a mt_univariateSummary object, showing the distribution of a binned variable x.

See Also

univariateSummary, plot_ly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# numeric x with missings
x <- c(rnorm(5000, 100, 10), rep(as.numeric(NA), 500))
z <- univariateSummary(x, numBins = 20)
relativeHistogram(z, "Random Normal")

# logical x
x <- round(runif(20))
z <- univariateSummary(x)
relativeHistogram(z, "Random Binary", "orange")

# character x
relativeHistogram(univariateSummary(iris$Species), "Species", "#77BF30")

dnegrey/miscTools documentation built on May 3, 2019, 2:57 p.m.