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.
This function is modified from the Hist() function in the Rcmdr package.
HistEZR() package in RcmdrPlugin.EZR uses hist2() insted of hist(). In hist2(),
the method to set breakpoints between histogram cells was changed from
"Sturges" to "Scott".
HistEZR(x, scale=c("frequency", "percent", "density"), xlab=deparse(substitute(x)),
ylab=scale, main="", ...)
This function returns NULL
, and is called for its side effect ---
plotting a histogram.
a vector of values for which a histogram is to be plotted.
the scaling of the vertical axis: "frequency"
(the default),
"percent"
, or "density"
.
x-axis label, defaults to name of variable.
y-axis label, defaults to value of scale
.
main title for graph, defaults to empty.
arguments to be passed to hist
.
data(iris, package="datasets")
HistEZR(iris$Petal.Length, scale="percent")
Run the code above in your browser using DataLab