Hist

0th

Percentile

Plot a Histogram

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.

Keywords
hplot
Usage
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 is primarily called for its side effect --- plotting a histogram or histograms --- but it also invisibly returns an object of class hist or a list of hist objects.

See Also

hist

Aliases
  • Hist
Examples
# NOT RUN {
    data(Prestige, package="car")
    Hist(Prestige$income, scale="percent")
    with(Prestige, Hist(income, groups=type))
    
# }
Documentation reproduced from package RcmdrMisc, version 2.7-0, License: GPL (>= 2)

Community examples

everton_toledo@hotmail.com at Mar 23, 2018 RcmdrMisc v1.0-6

# NOT RUN { data(Prestige, package="car") Hist(Prestige$income, scale="percent") with(Prestige, Hist(income, groups=type)) # }