univariateGraph: Produce a univariate graph

Description Usage Arguments Value See Also Examples

View source: R/univariateGraph.R

Description

univariateGraph() produces a univariate graph based on the contents of the input data frame, which must be a mt_univariateSummary object.

Usage

1
2
univariateGraph(data, xLabel, yLabel, yType, yDigits, yRangeMode = "tozero",
  barColor = "#BDDFF7", lineColor = "#000000")

Arguments

data

mt_univariateSummary data frame

xLabel

character string; x variable label

yLabel

character string; y variable label

yType

character string; y variable format type; valid values are "int", "dlr" and "pct"

yDigits

non-negative integer value indicating the number of decimal places to show for values of the y variable

yRangeMode

character string; "tozero" (y-axis starts at 0) or "auto" (y-axis extremes determined by data)

barColor

character string; fill color for bars (valid color)

lineColor

character string; line color (valid color)

Value

A plot_ly visualization of a mt_univariateSummary object, showing the distribution of a binned variable x overlayed with an aggregated summary statistic of a variable y.

See Also

univariateSummary, plot_ly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# numeric x logical y
x <- c(rnorm(5000, 100, 10), rep(as.numeric(NA), 500))
y <- runif(5500)
z <- univariateSummary(x, y < 0.50)
univariateGraph(z, "Random Normal", "Random Uniform", "pct", 1)

# numeric x continuous y
z <- univariateSummary(x, y*100, 2, numBins = 15)
univariateGraph(z, "Random Normal", "Random Uniform", "dlr", 0)

# character x continuous y
z <- univariateSummary(iris$Species, iris$Sepal.Length, 2)
univariateGraph(z, "Species", "Sepal Length", "int", 2)

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