View source: R/data_manip_utils.R
collapse_to_atomic | R Documentation |
If x
is already an atomc vector, it is not modified. If it is a
list, non-scalar elements are converted to scalars, and these are
concatenated to produce an atomic vector the same length as x
.
Specifically, list elements with 0 length are replaced by NA, and
elements with length greater than one are pasted together into
strings using sep
as the separator.
collapse_to_atomic(x, sep = ",")
x |
The list to convert. |
sep |
Separator to use for collapsing vectors to scalars. |
An atomic vector that same length and names as x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.