multiHist: ## Plot one or more histograms on the same axes using lines

Description Usage Arguments Value Author(s) Examples

Description

If obj is a vector, this function acts like graphics::hist, but only sketches a line along the top of the histogram, rather than plotting bars. If obj is a matrix or dataframe, it creates a line for each column.

Usage

1
2
multiHist(obj, lty = 1:ncol(obj), lwd = rep(1, ncol(obj)), col = rep(1, 
    ncol(obj)), ...)

Arguments

obj

A numeric/integer vector, dataframe, or matrix. If obj is a dataframe or matrix, a histogram line will be created for each column.

lty

lty for each histogram line.

lwd

lwd for each histogram line.

col

col for each histogram line.

...

Extra arguments passedon to graphics::hist

Value

Invisibly returns the output of hist() obj (vector) or the first column of obj (matrix or dataframe).

Author(s)

Levi Waldron and Markus Riester

Examples

1
2
3
4
5
x <- matrix(rnorm(2000), ncol=2)
x[, 2] <- x[, 2] - 2
multiHist(x)
multiHist(x[, 1])
multiHist(round(x[, 1] * 1000), xlab="x*1000", main="Integer input")

lwaldron/LeviRmisc documentation built on May 21, 2019, 8:59 a.m.