replace_with: replace_with

Description Usage Arguments Value

View source: R/utilities.R

Description

For each element in x, if it is present in the 'search_list', replace it with the corresponding value in the 'return_list'. Any element that is not in the 'search_list' is returned unaltered.

Usage

1
replace_with(x, search_list, return_list, strict = FALSE)

Arguments

x

A vector.

search_list

A vector.

return_list

A vector. This should be the same length as search_list.

strict

Boolean. Should every element of 'x' be present in search_list?

Value

A vector of the same length as x, containing some values from x and some values from return_list (so the class of the vector may be different from that for 'x').


russHyde/reeq documentation built on March 10, 2020, 5:36 a.m.