plot_freq: Histogram and frequency polygon

Description Usage Arguments Value See Also Examples

View source: R/plot_freq.R

Description

Creates an histogram and frequency polygon or a cummulative frequency polygon.

Usage

1
plot_freq(x, nclass = "Sturges", density = FALSE, cfp = FALSE)

Arguments

x

a numerical vector.

nclass

a character string. Method for calculation of the number of classes from a numerical random variable.

density

logical; if TRUE, the histogram graphic is a representation of frequencies, the counts component of the result; if FALSE, probability densities, component density, are plotted (so that the histogram has a total area of one).

cfp

logical, indicating if the plot is an histogram and frequency polygon or a cummulative frequency polygon.

Value

A ggplot2 object.

See Also

hist, geom_histogram, geom_freqpoly.

Examples

1
2
3
4
5
6
7
data <- rnorm(100)
plot_freq(data)
plot_freq(data, nclass = "FD", cfp = TRUE)

# Change graphical parameters
plot_freq(data) +
   theme_void()

rodianf/histogramR documentation built on May 14, 2019, 7:33 a.m.