fct_derive: Derive factor levels from another factor with unique...

View source: R/data-wrangling-factors.R

fct_deriveR Documentation

Derive factor levels from another factor with unique pair-wise matches

Description

Derive factor levels from another factor with unique pair-wise matches

Usage

fct_derive(new, old)

Arguments

new

A vector

old

A factor

Value

A factor

Examples

old <- factor(LETTERS[1:5], LETTERS[c(3, 2, 1, 5, 4)])
old
new <- letters[1:5]
new
factor(new)
fct_derive(new, old)

yjunechoe/penngradlings documentation built on Sept. 6, 2024, 8:13 p.m.