Sort and unique numbers | R Documentation |
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>
colSort, rowSort, sort_cor_vectors
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.