Using columns with special characters in formulae in R
This works:
dat <- data.frame(M=rnorm(10),'A/B'=1:10,check.names=F)
> lm(M~`A/B`,dat)
Call:
lm(formula = M ~ `A/B`, data = dat)
Coefficients:
(Intercept) `A/B`
-1.0494 0.1214
Joran's comment on my question is the answer - I didn't know of the existence of make.names()
Joran, if you reply as an answer I'll mark you as correct. Cheers!