color.plot.data.frame {mining} | R Documentation |
Like plot
and text.plot
but colors according to the response variable.
color.plot.data.frame(data,labels=F,...) color.plot.formula(formula, data=parent.frame(), ...)
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 . |
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.
Tom Minka
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)