Skip to content

Abstract the differences between character vectors and factors.

Usage

unique_or_levels(x)

Arguments

x

A character vector or a factor.

Value

A character vector with the unique elements of x if it is a character vector, or the levels of x if it is a factor.

Author

Michaja Pehl