Extract Variables from string vector
Takes a string including potentially model terms like *
and :
and extracts out the individual variables
extract_covariates(x)
x
: string of variable names potentially including interaction termsi.e. c("v1", "v2", "v2*v3", "v1:v2")
becomes c("v1", "v2", "v3")
Useful links