Provides a multiple figure array which shows the classification of observations based on
classification methods (e.g. lda
, qda
) for every combination of two variables.
Moreover, the classification borders are displayed and the apparent error rates are given in each title.
partimat(x,...)# S3 method for default
partimat(x, grouping, method = "lda", prec = 100,
nplots.vert, nplots.hor, main = "Partition Plot", name, mar,
plot.matrix = FALSE, plot.control = list(), ...)
# S3 method for data.frame
partimat(x, ...)
# S3 method for matrix
partimat(x, grouping, ..., subset, na.action = na.fail)
# S3 method for formula
partimat(formula, data = NULL, ..., subset, na.action = na.fail)
matrix or data frame containing the explanatory variables (required, if formula
is not given).
factor specifying the class for each observation (required, if formula
is not given).
formula of the form groups ~ x1 + x2 + ...
.
That is, the response is the grouping factor and the right hand side specifies the (non-factor) discriminators.
the method the classification is based on, currently supported are:
lda
, qda
, rpart
, naiveBayes
,
rda
, sknn
and svmlight
.
precision used to draw the classification borders (the higher the more precise; default: 100).
Data frame from which variables specified in formula are preferentially to be taken.
number of rows in the multiple figure array
number of columns in the multiple figure array
index vector specifying the cases to be used in the training sample. (Note: If given, this argument must be named.)
specify the action to be taken if NA
s are
found. The default action is for the procedure to fail. An
alternative is na.omit
, which leads to rejection of cases with
missing values on any required variable. (Note: If given, this argument must be named.)
title
Variable names to be printed at the axis / into the diagonal.
numerical vector of the form c(bottom, left, top, right)
which gives the lines of margin to be specified on the four sides of the plot.
Defaults are rep(0, 4)
if plot.matrix = TRUE
, c(5, 4, 2, 1) + 0.1
otherwise.
logical; if TRUE
, like a scatterplot matrix;
if FALSE
(default) uses less space and arranges the plots “optimal”
(using a fuzzy algorithm) in an array by plotting each pair of variables once.
A list containing further arguments passed to the underlying
plot functions (and to drawparti
).
Further arguments passed to the classification method
(through drawparti
).
Karsten Luebke, karsten.luebke@fom.de, Uwe Ligges, Irina Czogiel
for much more fine tuning see drawparti
library(MASS)
data(iris)
partimat(Species ~ ., data = iris, method = "lda")
if (FALSE) {
partimat(Species ~ ., data = iris, method = "lda",
plot.matrix = TRUE, imageplot = FALSE) # takes some time ...
}
Run the code above in your browser using DataLab