somRes
class objectProduce graphics to help interpreting a somRes
object.
# S3 method for somRes
plot(x, what=c("obs", "prototypes", "energy", "add"),
type=switch(what, "obs"="hitmap", "prototypes"="color", "add"="pie",
"energy"=NULL),
variable = if (what=="add") NULL else if (type=="boxplot")
1:min(5,ncol(x$data)) else 1,
my.palette=NULL,
is.scaled = if (x$parameters$type=="numeric") TRUE else FALSE,
print.title=FALSE, the.titles=if (what!="energy")
switch(type, "graph"=1:prod(x$parameters$the.grid$dim),
paste("Cluster", 1:prod(x$parameters$the.grid$dim))),
proportional=TRUE, s.radius=1, pie.graph=FALSE, pie.variable=NULL,
view = if (x$parameters$type=="korresp") "r" else NULL, ...)
A somRes
class object.
What you want to plot. Either the observations (obs
,
default case), the evolution of energy (energy
), the prototypes
(prototypes
) or an additional variable (add
).
Further argument indicating which type of chart you want to have.
Choices depend on the value of what
(what="energy"
has no
type
argument). Default values are "hitmap"
for obs
,
"color"
for prototypes
and "pie"
for add
. See
section ``Details'' below for further details.
Either the variable to be used for what="add"
or the
index of the variable of the data set to consider. For type="boxplot"
,
the default value is the sequence from 1 to the minimum between 5 and the
number of columns of the data set. In all other cases, default value is 1.
See somRes.plotting
for further details.
A vector of colors. If omitted, predefined palettes are
used, depending on the plot case. This argument is used for the following
combinations: all "color"
types and "prototypes"/"poly.dist"
.
A boolean indicating whether values should be scaled prior to
plotting or not. Default value is TRUE
when type="numeric"
and
FALSE
in the other cases.
Boolean used to indicate whether each neuron should have a
title or not. Default value is FALSE
. It is feasible on the following
cases: all "color"
types, all "lines"
types, all
"barplot"
types, all "radar"
types, all "boxplot"
types,
all "names"
types, "add"/"pie"
, "prototypes"/"umatrix"
,
"prototypes"/"poly.dist"
and "add"/"words"
.
The titles to be printed for each neuron if
print.title=TRUE
. Default to a number which identifies the neuron.
Boolean used when what="add"
and type="pie"
.
It indicates if the pies should be proportional to the number of observations
in the class. Default value is TRUE
.
The size of the pies to be plotted (maximum size when
proportional=TRUE
). The default value is 0.9
.
Boolean used when what="add"
and type="graph"
.
It indicates if the vertices should be pies or not.
The variable needed to plot the pies when
what="add"
, type="graph"
and argument pie.graph=TRUE
.
Used only when the algorithm's type is "korresp"
. It
indicates whether rows ("r"
) or columns ("c"
) must be drawn.
Further arguments to be passed to the underlined plot function
(which can be plot
, barplot
, pie
...
depending on type
; see somRes.plotting
for further
details).
See somRes.plotting
for further details.
trainSOM
to run the SOM algorithm, that returns a somRes
class object.