sortunique: Extract Unique Elements and Sort

Description Usage Arguments Examples

View source: R/Likert.R

Description

Return a vector with duplicates removed and sort it into ascending order.

Usage

1

Arguments

x

An R object with a class or a numeric, complex, character or logical vector

Examples

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)

alemiani/explora documentation built on May 28, 2019, 4:54 p.m.