numero.subgroup | R Documentation |
Plot self-organizing map colorings and let the user choose multi-district regions as subgroups
numero.subgroup(results, variables, topology = NULL, reference = NULL,
gain = 1, detach = FALSE, capacity = 9, automatic = FALSE)
results |
A list object that contains the self-organizing map and its statistical colorings. |
variables |
A string vector that contains names of variables to show on screen. |
topology |
A SOM topology or the output from a previous subgrouping session. |
reference |
Reference color ranges and scales. |
gain |
Modifier for overall color intensity. |
detach |
Use a detached window. |
capacity |
Maximum number of subplots to show on screen. |
automatic |
If greater than zero, automatic segmentation of the map is triggered, the value sets the number of subgroups. |
The input results
must contain the output from
numero.evaluate()
or similar.
The input argument topology
can be the structure of a SOM or with
additional columns as in the output from nroPlot()
.
The input argument reference
follows the output format from
numero.evaluate()
.
Setting detach to FALSE will also clear all devices whenever the figure is
refreshed. This may be inconvenient when using R from the terminal,
for example; please see the help page of numero.plot()
for
using a detached window device instead.
If any districts are left unmarked, they are automatically collected
into a subgroup of their own. If automatic
is set, user input
is skipped.
A data frame similar to the format returned by nroPlot()
.
# Import data.
fname <- system.file("extdata", "finndiane.txt", package = "Numero")
dataset <- read.delim(file = fname)
# Set identities and manage missing data.
dataset <- numero.clean(dataset, identity = "INDEX")
# Prepare training variables.
trvars <- c("CHOL", "HDL2C", "TG", "CREAT", "uALB")
trdata <- numero.prepare(data = dataset, variables = trvars)
# Create a self-organizing map.
sm <- numero.create(data = trdata)
qc <- numero.quality(model = sm)
# Evaluate map statistics for all variables.
stats <- numero.evaluate(model = qc, data = dataset)
# Define subgroups, uncomment to launch interactive window.
#elem <- numero.subgroup(results = stats, variables = trvars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.