[R] Reading data from a dataframe

David Winsemius dwinsemius at comcast.net
Sat Feb 9 18:52:44 CET 2008


Duncan Murdoch <murdoch at stats.uwo.ca> wrote in
news:47ADE367.8020405 at stats.uwo.ca: 

> On 09/02/2008 11:38 AM, David Winsemius wrote:
>> "Alexander Ovodenko" <ovodenko at princeton.edu> wrote in
snipped
>> 
>> Which creates the model and immediately discards it, because no
>> durable object was given the values:
>>  
>>> But when try to get a fitted line, I enter the following:
>>> with(pol572a1, lm( share.gnp)<-lm(incmean~rgnpc))  
>> 
>> That does not look particular sensible. Assuming that the goal was
>> to create a model object named share.gnp, then try instead:
>> 
>> with(pol572a1, share.gnp.mdl <-lm(incmean~rgnpc) ) 
> 
> That won't work:  share.gnp.mdl will be created in the local
> environment created by with(), and then discarded.  You need to put
> it outside, i.e. 
> 
> share.gnp.mdl <- with(pol572a1, lm(incmean~rgnpc) )
> 

Thank you for the correction. I see that I was committing the same error 
I had described above it albeit in a different manner. I do hope he first 
saw your earlier post, or that of Onkelinx suggesting the "data= " 
approach before following me into a blind alley.

-- 
David Winsemius



More information about the R-help mailing list