fac_from_num: create factors from numbers

View source: R/helpers.R

fac_from_numR Documentation

create factors from numbers

Description

If the number of unique numbers is five or fewer, then they will simply be converted to factors in order, otherwise, they will be passed to cut and pretty, preserving the lowest value.

Usage

fac_from_num(x)

Arguments

x

a vector of integers or numerics

Value

a factor

Examples

fac_from_num(1:100)
fac_from_num(sample(100, 5))

epikit documentation built on Feb. 16, 2023, 7:42 p.m.