replaceval: Replace/rename values in a vector

Description Usage Arguments Value Examples

Description

Replace/rename values in a vector

Usage

1
replaceval(x, ..., defaultValue = x)

Arguments

x

Vector of values to replace

...

Key/value pairs in the form oldvalue="newvalue"

defaultValue

A vector of values to use as the default should the value not be found in ...

Value

A vector with values replaced

Examples

1
2
3
4
x <- c("fish", "fish", "fish", "whistle")
replaceval(x, fish="newfish")
replaceval(x, whistle="newwhistle")
replaceval(x, fish="newfish", defaultValue="not a fish")

paleolimbot/ofcores documentation built on May 24, 2019, 6:13 p.m.