refactor_by_idx: Create a factor based on specified level:index pairs

Description Usage Arguments Value

View source: R/refactor.R

Description

refactor_by_idx changes x to a factor, and specifies level order based the 1:1 pairing of levs and idx

Usage

1
refactor_by_idx(x, levs, idx)

Arguments

x

A vector that will be converted to a factor based with level order specified by levs:idx pairing from.

levs

The levels contained in x

idx

The order in which levs will be incorporated into the new factor

Value

A factor with levels ordered according to levs:idx pairing


graggsd/sgcleanup documentation built on May 28, 2019, 8:53 p.m.