Description Usage Arguments Value Examples
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.
1 | genSwapFun(input, output)
|
input |
The input mapping |
ouput |
The output mapping |
A function that maps each input to a single output and returns a string
1 2 3 4 | swapFun<-genSwapFun(c("a","b"),c(1,2))
swapFun("a")==1
swapFun("b")==2
swapFun("c")==NA
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.