Extract Formula from lm including Categorical Variables (R)
问题 I have an lm object and want to get the formula extracted with coefficients. This object includes categorical variables like month, as well as interactions with these categorical variables and numeric ones. Another user helped with some code that works for all but the categorical variables, however when I add a categorical variable (eg. d here) it breaks down and gives the error "Error in parse(text = x) : :1:785: unexpected numeric constant": a = c(1, 2, 5, 13, 40, 29, 82, 22, 34, 54, 12, 31