Plot Distribution of Discrete Numeric Variable
Plot the distribution of a discrete numeric variable, optionally classified by a factor.
discretePlot(x, by, scale = c("frequency", "percent"),
xlab = deparse(substitute(x)), ylab = scale, main = "")x |
a numeric variable. |
by |
optionally a factor (or character or logical variable) by which to classify |
scale |
either |
xlab |
optional character string to label the horizontal axis. |
ylab |
optional character string to label the vertical axis. |
main |
optonal main label for the plot (ignored if the |
If the by argument is specified, then one plot is produced for each
level of by; these are arranged vertically and all use the same scale
for x.
Returns NULL invisibly.
John Fox jfox@mcmaster.ca
Hist, link{Dotplot}.
if (require(datasets)){
data(mtcars)
mtcars$cyl <- factor(mtcars$cyl)
with(mtcars, {
discretePlot(carb)
discretePlot(carb, scale="percent")
discretePlot(carb, by=cyl)
})
}Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.