HelponR wrote: > I am trying to use lm to do a simple regression but on a batch of > different files. > > Each file has different column names. > > I know the first column is the dependent variable and all the rest are > explanatory variables.
I believe > lm(data = thedataframe) (i.e. with no formula!) will use the first column as response and the rest as predictors. -- Bjørn-Helge Mevik ______________________________________________ R-help@stat.math.ethz.ch 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.