genSwapFun: genSwapFun

Description Usage Arguments Value Examples

Description

takes two equal length vectors and returns a function that maps each input to its corresponding output. This can be used to alias vectors if the mapping is known beforehand. Note: the input vector must consist of strings.

Usage

1
genSwapFun(input, output)

Arguments

input

The input mapping

ouput

The output mapping

Value

A function that maps each input to a single output and returns a string

Examples

1
2
3
4
swapFun<-genSwapFun(c("a","b"),c(1,2))
swapFun("a")==1
swapFun("b")==2
swapFun("c")==NA

alexjgriffith/CCCA documentation built on May 10, 2019, 8:52 a.m.