defaultLevels: Default Factor Levels

View source: R/default.R

defaultLevelsR Documentation

Default Factor Levels

Description

If x is numeric and all values are whole numbers use the sequence between the smallest and the highest value

Usage

defaultLevels(x, step = 1)

Arguments

x

numeric or character vector

step

step to be used in sequence generation

Value

if x is numeric the sequence between the lowest and highest value in x with the given step is returned. If x is a vector of character strings, the sorted unique values are returned.

Examples

defaultLevels(c(1, 3, 4, 5, 4))
defaultLevels(c(1920, 1950, 1970), step = 10)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.