f_modify_formula | R Documentation |
Modify components of a formula by adding / removing vars from the rhs or replacing the lhs.
f_modify_formula( f, rhs_remove = NULL, rhs_add = NULL, lhs_replace = NULL, negate = TRUE )
f |
formula |
rhs_remove |
regex or character vector for dropping variables from the rhs |
rhs_add |
character vector for adding variables to rhs |
lhs_replace |
string to replace formula lhs if supplied |
negate |
should |
formula
iris %>% tidy_formula(target = Species, tidyselect::everything()) -> f f f %>% f_modify_formula( rhs_remove = c("Petal.Width", "Sepal.Length"), rhs_add = "Custom_Variable" ) f %>% f_modify_formula( rhs_remove = "Petal", lhs_replace = "Petal.Length" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.