vecrep: Replace many elements in a vector at the same time

Description Usage Arguments Examples

View source: R/vecrep.r

Description

Replace many elements in a vector at the same time

Usage

1
vecrep(vec, from, to)

Arguments

vec

A vector

from

From what

to

To what

Examples

1
2
countries <- c('United States', 'Ecuador', 'Russia', 'Russia', 'Ecuador')
vecrep(vec=countries, from=c('Ecuador', 'Russia', 'United States'), to=c('ECU', 'RUS', 'USA'))

sckott/sacbox documentation built on May 26, 2017, 3:47 a.m.