Learn R Programming

BioMedR (version 1.2.1)

clusterPlotSOMmap: Plot self-organising map

Description

Plot self-organising map

Usage

clusterPlotSOMmap(x, index = NULL, main = NULL, label = NULL, pchs = 46,
  bgcol = NULL, cols = "red", lwds = 2, keepMargins = FALSE, ...)

Arguments

x

Kohonen object.

index

The location of the user's objective data

main

Title of the plot.

label

Labels to plot.

pchs

Symbols to plot.

bgcol

Optional argument to colour the unit backgrounds for the "mapping" and "codes" plotting type. Defaults to "gray" and "transparent" in both types, respectively.

cols

A specification for the default number color.

lwds

The number width, a positive number, defaulting to 1.

keepMargins

If FALSE (the default), restore the original graphical parameters after plotting the kohonen map. If TRUE, one retains the map coordinate system so that one can add symbols to the plot, or map unit numbers using the identify function.

...

other graphical parameters.

Value

plot mapping

Details

Plot self-organising map, obtained from function kohonen. shows where objects are mapped. It needs the classif argument, and a labels or pchs argument.

Examples

Run this code
# NOT RUN {
data(som.bcl)

clusterPlotSOMmap(som.bcl, pchs = 1)
idx = unique(som.bcl$unit.classif[1:80])
bgcols <- c("gray", "lightgreen")
index = rep(1, 5 * 5)
index[idx]  = 2
bgcol = bgcols[as.integer(index)]
label = c()
for (i in 1:length(idx)) {
  label[i] = length(which(som.bcl$unit.classif[1:80] == idx[i]))
  }

clusterPlotSOMmap(som.bcl, index = idx, label = label, bgcol = bgcol)
# }

Run the code above in your browser using DataLab