Sort and unique
Sort and unique numbers.
sort_unique(x) sort_unique.length(x)
x |
A numeric vector. |
The "sort_unique" function implements R's "unique" function using C++'s function but also sort the result. The "sort_unique.length" returns the length of the unique numbers only for itegers.
Returns the discrete values but sorted or their length (depending on the function you do).
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>
y <- rnorm(100) a <- sort_unique(y) b <- sort.int(unique(y)) all.equal(as.vector(a),as.vector(b)) x <- rpois(1000,10) sort_unique.length(x) length(sort_unique(x)) x<-a<-b<-NULL
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.