mapvalues: Replace values of a vector based on a mapping scheme.

View source: R/mapvalues.R

mapvaluesR Documentation

Replace values of a vector based on a mapping scheme.

Description

This is basically a copy or reimplementation of the plyr::mapvalues() function. It takes an input vector x as well as two vectors from and to that act as a dictionary for the mapping.

Usage

mapvalues(x, from, to)

Arguments

x

(any)
A vector.

from

(any)
A vector specifying the values that should be mapped.

to

(any)
A vector specifying the values to map to.

Value

(any)
A vector. It may be of a different type than the input vector x, depending on your inputs for from and to.


DavidJesse21/data.table.utils documentation built on March 26, 2023, 7:19 a.m.