mapvalues: mapvalues

Description Usage Arguments Details Value

Description

Replace specified values with new values, in a vector or factor. This is copied from plyr.

Usage

1
mapvalues(x, from, to, warn_missing = TRUE)

Arguments

x

the factor or vector to modify

from

a vector of the items to replace

to

a vector of replacement values

warn_missing

print a message if any of the old values are not actually present in x

Details

#' If x is a factor, the matching levels of the factor will be replaced with the new values.

The related revalue function works only on character vectors and factors, but this function works on vectors of any type and factors.

Value

Returns a vector with new values.


emilBeBri/dttools documentation built on April 21, 2021, 5:44 a.m.