powered by

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

mapClass(a, b)

A list with two named elements,

aTOb and

aTOb

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

bTOa

a

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

A numeric or character vector of class labels.

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

classError, table

classError

table

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)

Run the code above in your browser using DataLab