sunique: Utils

Description Usage Arguments Value Examples

View source: R/utils-functions.R

Description

Combination of sort() and unique().

Usage

1
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

1
2
3
4
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)

polypharmacy documentation built on July 12, 2021, 5:08 p.m.