bind_re_match {rematch2} | R Documentation |
Match results from a data frame column and attach results
Description
Taking a data frame and a column name as input, this function will run
re_match
and bind the results as new columns to the original
table., returning a tibble
. This makes it friendly for
pipe-oriented programming with magrittr.
Usage
bind_re_match(df, from, ..., keep_match = FALSE)
bind_re_match_(df, from, ..., keep_match = FALSE)
Arguments
df |
A data frame. |
from |
Name of column to use as input for |
... |
Arguments (including |
keep_match |
Should the column |
Functions
-
bind_re_match_
: Standard-evaluation version that takes a quoted column name.
Note
If named capture groups will result in multiple columns with the same
column name, repair_names
will be called on the
resulting table.
See Also
Standard-evaluation version bind_re_match_
that is
suitable for programming.
Examples
match_cars <- tibble::rownames_to_column(mtcars)
bind_re_match(match_cars, rowname, "^(?<make>\\w+) ?(?<model>.+)?$")