bind_re_match: Match results from a data frame column and attach results

Description Usage Arguments Functions Note See Also Examples

View source: R/bind_re_match.R

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

1
2
3
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 re_match. bind_re_match takes unquoted names, while bind_re_match_ takes quoted names.

...

Arguments (including pattern) to pass to re_match.

keep_match

Should the column .match be included in the results? Defaults to FALSE, to avoid column name collisions in the case that bind_re_match is called multiple times in succession.

Functions

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

1
2
match_cars <- tibble::rownames_to_column(mtcars)
bind_re_match(match_cars, rowname, "^(?<make>\\w+) ?(?<model>.+)?$")

rematch2 documentation built on May 1, 2020, 9:06 a.m.