unlistMap | R Documentation |
Function to unlist a one-to-one or one-to-many 'key-value' list
into
a named vector
. Useful for batched replacement of vector elements.
unlistMap(map, keep.unique = TRUE)
map |
A named list. Each element must be a vector. |
keep.unique |
Whether or not to remove elements with duplicated names from the output vector. |
A named vector whose names are original values in map
, and elements
are keys of map
map <- list(X = c("a", "b"), Y = c("c", "d"))
unlistMap(map)
map <- list(X = c("a", "b", "c"), Y = c("c", "d"))
unlistMap(map)
unlistMap(map, keep.unique = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.