| discretePlot | R Documentation |
Plot Distribution of Discrete Numeric Variable
discretePlot(
x,
by,
scale = c("frequency", "percent"),
xlab = deparse(substitute(x)),
ylab = scale,
main = "",
xlim = NULL,
ylim = NULL,
...
)
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 |
optional main label for the plot (ignored if the |
xlim |
two-element numeric vectors specifying the range of the x axes; if not specified, will be determined from the data. |
ylim |
two-element numeric vectors specifying the range of the y axes; if not specified, will be determined from the data; the lower limit of the y-axis should normally be 0 and a warning will be printed if it isn't. |
... |
other arguments to be passed to |
Plot the distribution of a discrete numeric variable, optionally classified by a factor.
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 the horizontal and vertical axes.
Returns NULL invisibly.
John Fox
Hist, Dotplot.
data(mtcars)
mtcars$cyl <- factor(mtcars$cyl)
with(mtcars, discretePlot(carb))
with(mtcars, discretePlot(carb, scale="percent"))
with(mtcars, discretePlot(carb, by=cyl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.