refactor: Change Factor Levels Using List Lookups

Description Usage Arguments Value Author(s) See Also

Description

Change Factor Levels Using List Lookups

Usage

1
refactor(x, new_values, throw_error = FALSE)

Arguments

x

A factor variable

new_values

A list

throw_error

If there are values in x which are not explicitly mapped in new_values, should the function throw an error?

Value

factor

Author(s)

Brendan Rocks rocks.brendan@gmail.com

See Also

refactor_list for generating code to feed to new_values in scripts. Other functions which aim to make factor munging less painful are the recode function in the car package, and mapvalues in plyr


brendan-R/brocks documentation built on May 13, 2019, 5:07 a.m.