This function is primarily a wrapper for separate, which turns a single character column into multiple columns
separate_tidy(
data,
col,
into = NULL,
sep = "_",
coerce_NA = TRUE,
na.strings = "NA",
message_inferred_into = TRUE,
...
)
A data frame containing new columns in the place of col
A data frame
Column name or position
A character vector of the new column names. Use NA
to
omit the variable in the output.
If NULL, separate_tidy
will attempt to infer the new
column names by splitting the column name of col
Separator between columns passed to separate:
If character, sep
is interpreted as a regular expression.
If numeric, sep
is interpreted as character positions
to split at. Positive values start at 1 at the far-left of the
string; negative values start at -1 at the far-right of the
string. The length of sep
should be one less than
into
logical dictating if strings matching any of
na.strings
will be coerced into NA
values
after separating.
A character vector of strings which are to be interpreted
as NA
values if coerce_NA == TRUE
logical whether column names for into
should be printed in a message when inferred
Other arguments passed to separate