Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: graphic
See also: transform

Quantlet: groupcol
Description: Decomposes a (color) vector into single groups.

Usage: {g, gind} = groupcol (col, ncol)
Input:
col scalar or color vector
ncol scalar, expected length of colorvector
Output:
gcol m x 1, different colors
gind n x 1, index of groups

Example:
; loads the library graphic
library("graphic")
; generate a color vector, e.g. for swiss banknote
col = matrix(5)|(4*matrix(5))
; computes the different colors
{gcol, gind} = groupcol(col, 10)
; show the different colors
gcol
; show the index vector(5 ones and 5 twos)
gind

Result:
decomposition of the color vector:
Contents of gcol
[1,]        1
[2,]        4
Contents of gind
[ 1,]        1
[ 2,]        1
[ 3,]        1
[ 4,]        1
[ 5,]        1
[ 6,]        2
[ 7,]        2
[ 8,]        2
[ 9,]        2
[10,]        2



Author: S. Klinke, 20010912
(C) MD*TECH Method and Data Technologies, 05.02.2006