Accepts a formula and returns the rhs as a character vector.

f_formula_to_charvec(f, include_lhs = FALSE, .data = NULL)

Arguments

f

formula

include_lhs

FALSE. If TRUE, appends lhs to beginning of vector

.data

dataframe for names if necessary

Value

chr vector

Examples


iris %>%
tidy_formula(target = Species, tidyselect::everything()) -> f

f
#> Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width
#> <environment: 0x0000018e818f8a50>

f %>%
f_formula_to_charvec()
#> [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"