Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

multhist

Plot a multiple histogram, as a barplot


Description

Given a list, plots a side-by-side barplot containing the histograms of the elements

Usage

multhist(x,beside=TRUE,freq=NULL,probability=!freq,plot.it=TRUE,...)

Arguments

x

a list of numeric vectors

beside

plot histogram bars for groups side-by-side?

freq

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). Defaults to 'TRUE' if 'probability' is not specified (does not consider equidistant breaks as in hist)

probability

an alias for '!freq', for S compatibility

plot.it

Whether or not to display the histogram.

...

additional arguments to hist or barplot

Value

A list including the return value for the first call to hist (itself a list) and the values for the bar heights.

Note

The 'inside' argument to barplot (which is not currently implemented in barplot anyway) is deleted from the argument list. The default value of NULL for freq is for consistency with hist but is equivalent to TRUE.

Author(s)

Ben Bolker

See Also

Examples

set.seed(1234)
 l <- list(runif(10)*10,1:10,c(1,1,1,1,4,8))
 multhist(l)

plotrix

Various Plotting Functions

v3.8-1
GPL (>= 2)
Authors
Jim Lemon, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowlingson, Hadley Wickham, Anupam Tyagi, Olivier Eterradossi, Gabor Grothendieck, Michael Toews, John Kane, Rolf Turner, Carl Witthoft, Julian Stander, Thomas Petzoldt, Remko Duursma, Elisa Biancotto, Ofir Levy, Christophe Dutang, Peter Solymos, Robby Engelmann, Michael Hecker, Felix Steinbeck, Hans Borchers, Henrik Singmann, Ted Toal, Derek Ogle, Darshan Baral, Ulrike Groemping, Bill Venables
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.