msub: Multiple substitution of values

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Makes a pair-wise substitions of a vector of values by another vector of values of same length.

Usage

1
msub(x, old, new)

Arguments

x

a numerical vector, matrix or data frame.

old

a vector of values to substitute.

new

a vector of values that will substitute old values.

Value

a vector with new values.

Examples

1
2
# Replace 1 for 2, 2 for 3 and 3 for 4.
msub(1:3, 1:3, 2:4)

brickmanlab/commonR documentation built on Dec. 19, 2021, 11:44 a.m.