recode: Recode values

View source: R/recode.R

recodeR Documentation

Recode values

Description

recode() recodes values in x by matching elements in from onto values in to.

Usage

recode(x, from = unique(na.omit(x)), to = from, .no_match = x, .na = NA)

Arguments

x

An atomic vector of values are to be recoded.

from

A vector of values to be matched in x for recoding.

to

A vector of values to be used as replacement for values in from.

.no_match

Value to be used as replacement when cases in from are not matched.

.na

Value to be used to recode missing values.

Value

A vector of recoded values.


sdtm.oak documentation built on April 3, 2025, 9:37 p.m.