Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unmap

Indicator Variables given Classification


Description

Converts a classification into a matrix of indicator variables.

Usage

unmap(classification, groups=NULL, noise=NULL, ...)

Arguments

classification

A numeric or character vector. Typically the distinct entries of this vector would represent a classification of observations in a data set.

groups

A numeric or character vector indicating the groups from which classification is drawn. If not supplied, the default is to assumed to be the unique entries of classification.

noise

A single numeric or character value used to indicate the value of groups corresponding to noise.

...

Catches unused arguments in indirect or list calls via do.call.

Value

An n by m matrix of (0,1) indicator variables, where n is the length of classification and m is the number of unique values or symbols in classification. Columns are labeled by the unique values in classification, and the [i,j]th entry is 1 if classification[i] is the jth unique value or symbol in sorted order classification. If a noise value of symbol is designated, the corresponding indicator variables are relocated to the last column of the matrix.

See Also

Examples

z <- unmap(iris[,5])
z[1:5, ]
  
emEst <- me(modelName = "VVV", data = iris[,-5], z = z)
emEst$z[1:5,]
  
map(emEst$z)

mclust

Gaussian Mixture Modelling for Model-Based Clustering, Classification, and Density Estimation

v5.4.10
GPL (>= 2)
Authors
Chris Fraley [aut], Adrian E. Raftery [aut] (<https://orcid.org/0000-0002-6589-301X>), Luca Scrucca [aut, cre] (<https://orcid.org/0000-0003-3826-0484>), Thomas Brendan Murphy [ctb] (<https://orcid.org/0000-0002-5668-7046>), Michael Fop [ctb] (<https://orcid.org/0000-0003-3936-2757>)
Initial release
2022-05-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.