Description Usage Arguments Value Examples
Convert all list-columns of a data frame into character vectors.
1 2 3 4 5 6 7 | listcol_to_chr(
df,
atom_sep = ";",
list_sep = "|",
simplify_threshold = Inf,
simplify_sep = "->"
)
|
df |
a data frame containing list-columns. |
atom_sep |
separator for the elements of atomic vectors. |
list_sep |
separator for the elements of lists. |
simplify_threshold |
non-negative number of atomic elements from which the character string is simplified (only first and last elements separated by a separator, "->" by default). |
simplify_sep |
a separator (one or several characters) if the string has to be simplified. |
A data frame. Simple columns (atomic) remain the same, list-columns (recursive) are transformed into character vectors.
1 2 3 4 | df <- data.frame(x = 1:2)
df$y <- list(letters[1:3], 1:2)
df$z <- list(list(3:4, 5:7), "d")
listcol_to_chr(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.