fct_idx: Transform levels of a factor with a function of their index

Description Usage Arguments Value

View source: R/factors.R

Description

Change the factor levels by a function or pattern based on their current order, .e.g. 1, 2, 3, ....

Usage

1
fct_idx(f, .f = "%d", ...)

Arguments

f

A factor

.f

If a character vector, a sprintf pattern in which the only argument will be the order of the factor levels. If a function, then a function in which the first argument is the order of the factor levels.

...

Arguments passed to .f if it is a function.

Value

A factor vector with the values of f and transformed levels.


jrnold/rubbish documentation built on May 20, 2019, 2:05 a.m.