[R] can lm() automatically take in the independent variables without knowing the names in advance

Bjørn-Helge Mevik bhs2 at mevik.net
Mon Oct 9 09:58:26 CEST 2006


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



More information about the R-help mailing list