plot.factor {graphics}
Description
This functions implements a scatterplot method for factor arguments of the generic plot function.
If y is missing barplot is produced. For numeric y a boxplot is used, and for a factor y a spineplot is shown. For any other type of y the next plot method is called, normally plot.default.
Usage
## S3 method for class 'factor': plot((x, y, legend.text = NULL, ...))
Arguments
- x, y
- numeric or factor.
ymay be missing. - legend.text
- character vector for annotation of y axis in the case of a factor
y: defaults tolevels(y). This sets theyaxlabelsargument ofspineplot. - ...
- Further arguments to
barplot,boxplot,spineplotorplotas appropriate. All of these accept graphical parameters (seepar) and annotation arguments passed totitleandaxes = FALSE. None accepttype.
See Also
Examples
require(grDevices) plot(weight ~ group, data = PlantGrowth) # numeric vector ~ factor plot(cut(weight, 2) ~ group, data = PlantGrowth) # factor ~ factor ## passing "..." to spineplot() eventually: plot(cut(weight, 3) ~ group, data = PlantGrowth, col = hcl(c(0, 120, 240), 50, 70)) plot(PlantGrowth$group, axes = FALSE, main = "no axes") # extremely silly
Documentation reproduced from R 3.0.1. License: GPL-2.
