File: mapClass.Rd

package info (click to toggle)
r-cran-mclust 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,540 kB
  • sloc: fortran: 13,298; ansic: 201; sh: 4; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\name{mapClass}
\alias{mapClass}

\title{Correspondence between classifications}

\description{
  Best correspondence between classes given two vectors viewed
  as alternative classifications of the same object.
}
\usage{
mapClass(a, b)
}
\arguments{
  \item{a}{
    A numeric or character vector of class labels.
  }
  \item{b}{
    A numeric or character vector of class labels.
    Must have the same length as
    \code{a}.
  }
  
}
\value{
  A list with two named elements, 
  \code{aTOb} and 
  \code{bTOa} which are themselves lists. 
  The \code{aTOb} list has a component corresponding
  to each unique element of \code{a}, which gives
  the element or elements of \code{b} 
  that result in the closest class correspondence.
  
  The \code{bTOa} list has a component corresponding
  to each unique element of \code{b}, which gives
  the element or elements of \code{a} 
  that result in the closest class correspondence.
}
\seealso{
  \code{\link{classError}},
  \code{\link{table}}
}
\examples{
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)
}
\keyword{cluster}