Learn R Programming

polypharmacy (version 1.0.0)

sunique: Utils

Description

Combination of sort() and unique().

Usage

sunique(x, decreasing = FALSE, na.last = FALSE)

Arguments

x

Vector to sort and remove duplicates.

decreasing

TRUE or FALSE.

na.last

NA removes NAs, TRUE show NAs at the end and FALSE show NAs at the beginning.

Value

x sorted and without duplicates.

Examples

Run this code
# NOT RUN {
sunique(c(1, 1, 1, 2, 2, NA, NA))
sunique(c(1, 1, 1, 2, 2, NA, NA), na.last = TRUE)
sunique(c(1, 1, 1, 2, 2, NA, NA), na.last = NA)
sunique(c(1, 1, 1, 2, 2, NA, NA), decreasing = TRUE)
# }

Run the code above in your browser using DataLab