File: partuniq.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 (37 lines) | stat: -rw-r--r-- 742 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
\name{partuniq}
\alias{partuniq}
\title{
  Classifies Data According to Unique Observations
}
\description{
  Gives a one-to-one mapping from unique observations to rows of a data matrix.
}
\usage{
partuniq(x)
}
\arguments{
  \item{x}{Matrix of observations.}
}
\value{
  A vector of length \code{nrow(x)} with integer entries. An observation
  \code{k} is assigned an integer \code{i} whenever observation \code{i}
  is the first row of \code{x} that is identical to observation \code{k}
  (note that \code{i <= k}).
}
\seealso{
   \code{\link{partconv}}
}
\examples{
set.seed(0)

mat <- data.frame(lets = sample(LETTERS[1:2],9,TRUE), nums = sample(1:2,9,TRUE))
mat

ans <- partuniq(mat)
ans

partconv(ans,consec=TRUE)
}
\keyword{cluster}