Learn R Programming

mappings (version 0.2.0)

remap: Re-map a variable

Description

Apply a mapping to a vector directly. The mapping is temporary and not saved.

Usage

remap(x, ...)

Value

The values returned by calling the mapping function.

Arguments

x

The values to apply the mapping to.

...

Passed to mapping().

Examples

Run this code
x <- c("A", "B", "A")
remap(x, c(A=0, B=1))

Run the code above in your browser using DataLab