sub_value: Substitute exact matches within a vector with another value

Description Usage Arguments Value

View source: R/sub.R

Description

sub_value finds exact matches within x specified by from and substitutes them with values specified in to. Values specified by from will be replaced in a 1:1 or many:1 fashion. Only values within from that are contained in x will be replaced.

Usage

1
sub_value(x, from, to)

Arguments

x

A vector of values, some (or all) of which are equivalent to values in from and will be replaced by values in to

from

A vector of values potentially contained within x that are to be substituted

to

The corresponding value (or values) that from will be converted to

Value

A new vector, derived from x, with 0 or more values substituted for new ones


graggsd/sgcleanup documentation built on May 28, 2019, 8:53 p.m.