h: Custom histogram with additional descriptive stats

Description Usage Arguments Value Examples

View source: R/plot_templates.r

Description

This custom histogram is a wrapper function for a custiomized ggplot generated histogram. Additional descriptive statistics are calculated with function des.

Usage

1
2
3
h(x, binwidth = NULL, xlab = NULL, ylab = "count", lowerlimit = NA,
  upperlimit = NA, info = T, density = F, perc = F, fontsize = 4,
  text_horizontal_position = "right", fill_color = "#d3d3d3")

Arguments

x

a vector

binwidth

Optional. width of a histogram bin.

xlab

Optional. X-axis label.

ylab

Optional. Y-axis label.

lowerlimit

Optional. Lower limit of the histogram

upperlimit

Optional. Upper limit of the histogram

info

Optional. Logical - should the descriptive stats be ploted?

density

Optional. Logical - Plot density plot instead of histogram.

perc

Optional. Logical - Should the counts for each bin be converted to percent?

text_horizontal_position

Optional. Horizontal position of the info box. Default = "right". Can be "left" or a numerical value indicating the position of the left side of the box.

fill_color

Color of the histogram bars.

fontize

Optional. Fontsize of the plot text elements.

Value

histogram of x

Examples

1
h(iris$Sepal.Length)

ptompalski/UsefulRFunctions documentation built on May 26, 2019, 11:32 a.m.