color.plot.data.frame {mining}R Documentation

Plot cases as colored points

Description

Like plot and text.plot but colors according to the response variable.

Usage

color.plot.data.frame(data,labels=F,...)
color.plot.formula(formula, data=parent.frame(), ...)

Arguments

data a data frame.
formula a formula specifying a response and two predictors from data
labels If NULL, cases are plotted as points. If T, cases are plotted as labels, according to rownames.
... Extra arguments passed to color.plot.default.

Details

Calls color.plot.default with x as the first predictor in data, y as the second predictor, and z as the response. To get a different predictor/response breakdown than the default, use color.plot(formula, x, ...), which is shorthand for color.plot(model.frame(formula, x), ...).

Each case is plotted with a color determined by the response. If the response is a factor, each factor level is in a different color. If the response is numeric, then it is color-coded by assigning each quantile a different color.

Author(s)

Tom Minka

See Also

color.plot.default

Examples

data(iris)
color.plot(iris)
color.plot(Species ~ Petal.Length + Petal.Width, iris)
color.plot(Species ~ Petal.Length, iris)
color.plot(Species ~ Petal.Length, iris,jitter=T)
color.plot(iris, col=1)
color.plot(iris, col=c(1,2))

data(state)
x <- data.frame(state.x77)
color.plot(Murder ~ Frost + Illiteracy, x, labels=T, cex=0.5)

[Package Contents]