Re: [R] Reading data from a dataframe

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Sat, 9 Feb 2008 17:52:44 +0000 (UTC)

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

______________________________________________
R-help_at_r-project.org 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.
Received on Sat 09 Feb 2008 - 17:56:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 09 Feb 2008 - 18:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive