su: su: Sorted unique values

View source: R/su.R

suR Documentation

su: Sorted unique values

Description

Extract unique elements and sort them

Usage

su(x = NULL, na.last = TRUE, decreasing = FALSE)

Arguments

x

a vector or a data frame or an array or NULL.

na.last

an argument to be passed onto the 'sort' function (in base R) for controlling the treatment of NA values. If na.last = TRUE, NA values in the data are put last; if na.last = FALSE, NA values are put first; if na.last = NA, NA values are removed. By default, na.last = TRUE

decreasing

logical. Should the sort be increasing or decreasing? An argument to be passed onto the 'sort' function (in base R). By default, decreasing = FALSE

Value

a vector, data frame, or array-like 'x' but with duplicate elements/rows removed.

Examples

su(c(10, 3, 7, 10, NA))
su(c("b", "z", "b", "a", NA, NA, NA))

kim documentation built on Oct. 9, 2023, 5:08 p.m.

Related to su in kim...