[R] about lm

David Winsemius dwinsemius at comcast.net
Sat Nov 17 17:31:01 CET 2012


On Nov 17, 2012, at 4:29 AM, FJ M wrote:

>
> dat=read.csv("c:\\ven.csv",header=TRUE,sep=";");
> attach(attach(dat))

It is generally less error prone to avoid attach (even once).
> dat
> lm.1<-lm(ve~ su)

And instead use:

lm.1<-lm(ve~ su, data=dat)

> summary(lm.1)
>
> GL Frank
>> Date: Fri, 16 Nov 2012 20:42:39 +0100
>> From: soniaamin5 at gmail.com
>> To: r-help at r-project.org
>> Subject: [R] about lm
>>
>> Dear friends,
>> I have a csv file entitled ven.csv located in C:\\, this file  
>> contains only
>> two columns:"ve" and "su" I have written the following lines:
>> data=read.csv("c:\\ven.csv",header=TRUE,sep=";");
>>
>> lm(ve~ su)
>> I have obtained the following message:
>>
>> Error in eval(expr, envir, enclos) : object 've' does not exist.  
>> What's the
>> problem? thank you for your help in advance
>>
>> [[alternative HTML version deleted]]
>>

When you do get around to reading the Posting Guide, please note the  
section where the request to NOT post in HTML is made.

> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list