plot.connectedness {connectedness} | R Documentation |
plot.connectedness
plots disconnected sets for two-way
classification without interaction.
plot.connectedness(x, set=NULL, matrix=TRUE, scale=TRUE, lines=FALSE, linesSet=NULL, col=NULL, plotArg=list(xlab=x$factors[1], ylab=x$factors[2]), polygonArg=NULL, pointsArg=list(pch=rep(19, x$nSets)), linesArg=NULL, ...)
x |
connectedness, output from connectedness |
set |
integer, which set to plot, all sets if NULL |
matrix |
boolean, if TRUE, plot a matrix of polygons, otherwise plot points |
scale |
boolean, if TRUE, scale axes in relation to number of records per each level, otherwise not |
lines |
boolean, connect cells with lines within sets |
linesSet |
numeric, set number i.e. which sets should have connected cells |
col |
character, valid color "names" for cell polygons or points, see details |
plotArg |
list, arguments passed to plot |
polygonArg |
list, arguments passed to polygon , see details |
pointsArg |
list, arguments passed to points if
matrix=FALSE, see details |
linesArg |
list, arguments passed to lines if lines=TRUE,
see details |
... |
arguments for other methods, not used |
Colors for polygons, points and lines can be given with col
or separately with ploygonArg
, pointsArg
and
linesArg
. By default col
is NULL and colors are given
internally. Set of colors is taken from RColorBrewer package,
specifically from qualitative palettes. Read help page of
brewer.pal
for more. Only 54 colors are
defined and an error is issued, if there are more than 54 sets in your
data. You should define colors by yourself in that case. For a start
you can access 54 internal colors with connectedness:::.colors
.
Length of all arguments in ploygonArg
, pointsArg
and
linesArg
is assumed to be equal to then number of sets in
x
. If it is less, recycling will occur. Therefore, result might
be a mess, unless length of arguments is 1. In last case all set
will have equal value for the corresponding argument(s).
Gregor Gorjanc
connectedness
, levelsBySet
and
subset.connectedness
data(connect) table(connect$group, connect$season) tmp <- connectedness(x=connect$group, y=connect$season) ## Plot method par(mfrow=c(2, 2)) plot(tmp) plot(tmp, matrix=FALSE, lines=TRUE, col=c("red", "blue"), pointsArg=list(pch=c(15, 19), cex=2), linesArg=list(lwd=2)) plot(tmp, scale=FALSE, lines=TRUE, linesSet=1, linesArg=list(col="black", lwd=2)) plot(tmp, set=2, col=c("gray"), plotArg=list(xlab="Group", ylab="Season"))