factor_regex: Generate Regular Expression to Detect Factors

Description Usage Arguments Value Author(s) Examples

View source: R/factor_regex.R

Description

Primarily developed for use within tidycat::tidy_categorical()

Usage

1
factor_regex(m, at_start = TRUE)

Arguments

m

A model object, created using a function such as stats::lm()

at_start

Logical indicating whether or not to include ^ in the regular expression to begin search at start of string

Value

A character string for use as a regular expression.

Author(s)

Guy J. Abel

Examples

1
2
m0 <- lm(formula = mpg ~ disp + as.factor(am)*as.factor(vs), data = mtcars)
factor_regex(m = m0)

tidycat documentation built on Aug. 2, 2021, 9:07 a.m.