50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

epikit (version 0.1.6)

fac_from_num: 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)

Value

a factor

Arguments

x

a vector of integers or numerics

Examples

Run this code
fac_from_num(1:100)
fac_from_num(sample(100, 5))

Run the code above in your browser using DataLab