Numero (version 1.2.0)

numero.subgroup: Interactive subgroup assignment

Description

Plot self-organizing map colorings and let the user choose multi-district regions as subgroups

Usage

numero.subgroup(results, variables, elements = NULL, reference = NULL,
                gain = 1, detach = FALSE, capacity = 9)

Arguments

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.

elements

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.

Value

A data frame similar to the format returned by nroPlot().

Details

The input results must contain the output from codenumero.evaluate() or similar.

The input argument elements can be the topology of a SOM or with additional columns as in the output from numero.subgroup().

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 detached window device instead.

If any districts are left unmarked, they are automatically collected into a subgroup of their own.

Examples

Run this code
# NOT RUN {
# 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.
modl <- numero.create(data = trdata)

# Evaluate map statistics for all variables.
stats <- numero.evaluate(model = modl, data = dataset)

# Define subgroups, uncomment to launch interactive window.
warning("Interactive example of numero.subrgoup() disabled.")
#elem <- numero.subgroup(results = stats, variables = trvars)
# }

Run the code above in your browser using DataLab