Skip to content
Prev 56135 / 63424 Next

Documentation examples for lm and glm

FWIW, before all the examples are changed to data frame variants, I think there's fairly good reason to have at least _one_ example that does _not_ place variables in a data frame. 

The data argument in lm() is optional. And there is more than one way to manage data in a project. I personally don't much like lots of stray variables lurking about, but if those are the only variables out there and we can be sure they aren't affected by other code, it's hardly essential to create a data frame to hold something you already have. 
Also, attach() is still part of R, for those folk who have a data frame but want to reference the contents across a wider range of functions without using with() a lot. lm() can reasonably omit the data argument there, too.

So while there are good reasons to use data frames, there are also good reasons to provide examples that don't.

Steve Ellison
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}