View source: R/separate_wider_delim.R
separate_wider_delim | R Documentation |
Separates a single column into multiple columns
separate_wider_delim(
.df,
cols,
delim,
...,
names = NULL,
names_sep = NULL,
names_repair = "check_unique",
too_few = c("align_start", "error"),
too_many = c("drop", "error"),
cols_remove = TRUE
)
.df |
A data frame |
cols |
Columns to separate |
delim |
Delimiter to separate on |
... |
These dots are for future extensions and must be empty. |
names |
New column names to separate into |
names_sep |
Names separator |
names_repair |
Treatment of duplicate names. See |
too_few |
What to do when too few column names are supplied |
too_many |
What to do when too many column names are supplied |
cols_remove |
Should old columns be removed |
df <- tidytable(x = c("a", "a_b", "a_b", NA))
df %>%
separate_wider_delim(x, delim = "_", names = c("left", "right"))
df %>%
separate_wider_delim(x, delim = "_", names_sep = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.