do_recode: Recode a vector

View source: R/do_recode.R

do_recodeR Documentation

Recode a vector

Description

Recode a vector

Usage

do_recode(x, old, new, new_label = NULL, update = FALSE, verbose = FALSE)

Arguments

x

some vector to be transformed

old

character (or coercible). value in the x to be translated into a new value by recoding.

new

character (or coercible). Column indicating where the new values for the recoding process exist. It is positionally tied to a particular old. If blank, it helps identify a simpler rename operation.

new_label

character (or convertable to character). The factor label that old will be recoded to in conjunction with the position of new. If NULL or all NA indicates no (new) labelling

update

logical. Governs whether x is modified in place. If x is a factor, this will also carry forward any labels unless overwritten by new_label

verbose

logical. Should warnings be displayed/provided?


PHSKC-APDE/rads documentation built on April 14, 2025, 10:47 a.m.