mapClass: Correspondence between classifications.

Description Usage Arguments Value See Also Examples

View source: R/mclustda.R

Description

Best correspondence between classes given two vectors viewed as alternative classifications of the same object.

Usage

1
mapClass(a, b)

Arguments

a

A numeric or character vector of class labels.

b

A numeric or character vector of class labels. Must have the same length as a.

Value

A list with two named elements, aTOb and bTOa which are themselves lists. The aTOb list has a component corresponding to each unique element of a, which gives the element or elements of b that result in the closest class correspondence.

The bTOa list has a component corresponding to each unique element of b, which gives the element or elements of a that result in the closest class correspondence.

See Also

mapClass, classError, table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
a <- rep(1:3, 3)
a
b <- rep(c("A", "B", "C"), 3)
b
mapClass(a, b)
a <- sample(1:3, 9, replace = TRUE)
a
b <- sample(c("A", "B", "C"), 9, replace = TRUE)
b
mapClass(a, b)

mclust documentation built on Nov. 22, 2017, 5:05 p.m.