View source: R/separate_rows.R
separate_rows | R Documentation |
Superseded
separate_rows()
has been superseded by separate_longer_delim()
.
If a column contains observations with multiple delimited values, separate them each into their own row.
separate_rows(.df, ..., sep = "[^[:alnum:].]+", convert = FALSE)
.df |
A data.frame or data.table |
... |
Columns to separate across multiple rows. |
sep |
Separator delimiting collapsed values |
convert |
If TRUE, runs |
df <- data.table(
x = 1:3,
y = c("a", "d,e,f", "g,h"),
z = c("1", "2,3,4", "5,6")
)
separate_rows(df, y, z)
separate_rows(df, y, z, convert = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.