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

From: Bjørn-Helge Mevik <>
Date: Mon 09 Oct 2006 - 07:58:26 GMT

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

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon Oct 09 18:00:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 09 Oct 2006 - 09:30:09 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.