Description Usage Arguments Examples
Return a vector with duplicates removed and sort it into ascending order.
1 | sortunique(x)
|
x |
An R object with a class or a numeric, complex, character or logical vector |
1 2 3 4 5 6 7 8 | # with numeric vector
x <- c(1,2,3,4,5,6,7,8,9,4,3,2,5,4,1,1,2,3,4,7,8,7,NA,1,2,3,5,4,0,6,7,5,4,5,6)
sortunique(x)
# with characters
x <- c('Sort', 'or', 'or', '(', ')','or', 'or', 'or', 'order', 'a', 'vector', 'or', 'factor', 'partially', 'into', 'ascending')
sortunique(x)
# with factors
sortunique(ToothGrowth$supp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.