Description Usage Arguments Value Examples
Given an array and a named list, maps values from the array to the right hand side of the named list.
1 | map_values(x, map, if_null = NULL)
|
x |
Array |
map |
Named list |
if_null |
Value to use if not present in map, if if_null == NULL, then the missing values will be omitted. |
array of mapped values
1 2 3 4 | x <- c(2, 2, 1, 2, 1, 3, 4)
map <- list('1' = 'one', '2' = 'two', '2' = 'three')
new_values <- map_values(x, map)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.