Hi, if I know the colnames x and y in the following example, I can easily to do lm. tmp <- data.frame(x=c(1,1.2),y=c(1,2)) lm(y ~ x, data=tmp)
when the colnames are variable, what should I do? for example colnames(tmp)[1] <- paste("aa",1,sep="_") lm(y ~ paste("aa",1,sep="_"), data = tmp) it gives me error. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.