Hist: Plot a Histogram

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plots.R

Description

This function is a wrapper for the hist function in the base package, permitting percentage scaling of the vertical axis in addition to frequency and density scaling.

Usage

1
2
Hist(x, groups, scale=c("frequency", "percent", "density"), xlab=deparse(substitute(x)), 
    ylab=scale, main="", breaks = "Sturges", ...)

Arguments

x

a vector of values for which a histogram is to be plotted.

groups

a factor to create histograms by group with common horizontal and vertical scales.

scale

the scaling of the vertical axis: "frequency" (the default), "percent", or "density".

xlab

x-axis label, defaults to name of variable.

ylab

y-axis label, defaults to value of scale.

main

main title for graph, defaults to empty.

breaks

see the breaks argument for hist.

...

arguments to be passed to hist.

Value

This function returns NULL, and is called for its side effect — plotting a histogram.

Author(s)

John Fox jfox@mcmaster.ca

See Also

hist

Examples

1
2
3
4
    data(Prestige, package="car")
    Hist(Prestige$income, scale="percent")
    with(Prestige, Hist(income, groups=type))
    

RcmdrMisc documentation built on May 29, 2017, 1:53 p.m.

Search within the RcmdrMisc package
Search all R packages, documentation and source code