powered by
Split interaction terms into their component variables
split_interactions(x, by = "\\*|:")
a vector of strings where each element is a component variable extracted from interaction term x.
x
(character) string representing the interaction usually in the form x:y or x*y.
character
x:y
x*y
(character) regex with which to split the interaction term by.
split_interactions("x:y") split_interactions("x*y")
Run the code above in your browser using DataLab