) Error in eval(expr, envir, enclos) : object '' not found

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

) Error in eval(expr, envir, enclos) : object '' not found

mipplor
> datafilename="E:/my documents/r/sex/bysex1.csv"
> data.sex=read.table(datafilename,header=T)
> data.sex
       y.sex.age.region.c.n
1   1980,F,A,N,-18.15,13.61
2   1980,F,A,N,-18.61,13.04
3   1980,F,A,N,-18.81,12.32
4    1990,F,A,N,-21.12,11.7
5   1990,F,A,N,-20.77,11.58
6    1990,F,A,N,-21.6,13.34
7    1990,F,A,N,-21.78,12.6

> model.anova<-aov(c~age*sex,data=data.sex)
Error in eval(expr, envir, enclos) : object 'age' not found


   i just wanna do a anova test. but the error message is as above,,,
   what should i do to shoot this problem ? Should i define the age?
Reply | Threaded
Open this post in threaded view
|

Re: ) Error in eval(expr, envir, enclos) : object '' not found

David Winsemius

On Mar 23, 2011, at 9:31 AM, mipplor wrote:

>> datafilename="E:/my documents/r/sex/bysex1.csv"
>> data.sex=read.table(datafilename,header=T)
>> data.sex
>       y.sex.age.region.c.n
> 1   1980,F,A,N,-18.15,13.61
> 2   1980,F,A,N,-18.61,13.04
> 3   1980,F,A,N,-18.81,12.32
> 4    1990,F,A,N,-21.12,11.7
> 5   1990,F,A,N,-20.77,11.58
> 6    1990,F,A,N,-21.6,13.34
> 7    1990,F,A,N,-21.78,12.6
>
>> model.anova<-aov(c~age*sex,data=data.sex)
> Error in eval(expr, envir, enclos) : object 'age' not found
>
>
>   i just wanna do a anova test. but the error message is as above,,,
>   what should i do to shoot this problem ? Should i define the age?

You should read the help page for read.table more thoroughly with  
particular attention to the `sep` argument. At the moment you have one  
column in your data.frame.

--

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ) Error in eval(expr, envir, enclos) : object '' not found

Jonathan P Daily
In reply to this post by mipplor
It looks like your column name has periods in it somewhere. Is your header
separated by something other than commas?

look at:
names(data.sex)

or test by

"age" %in% names(data.sex)
--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
 the thing itself have purpose? Or do we, what's the word... imbue it."
     - Jubal Early, Firefly

[hidden email] wrote on 03/23/2011 09:31:40 AM:

> [image removed]
>
> [R] ) Error in eval(expr, envir, enclos) : object '' not found
>
> mipplor
>
> to:
>
> r-help
>
> 03/23/2011 10:11 AM
>
> Sent by:
>
> [hidden email]
>
> > datafilename="E:/my documents/r/sex/bysex1.csv"
> > data.sex=read.table(datafilename,header=T)
> > data.sex
>        y.sex.age.region.c.n
> 1   1980,F,A,N,-18.15,13.61
> 2   1980,F,A,N,-18.61,13.04
> 3   1980,F,A,N,-18.81,12.32
> 4    1990,F,A,N,-21.12,11.7
> 5   1990,F,A,N,-20.77,11.58
> 6    1990,F,A,N,-21.6,13.34
> 7    1990,F,A,N,-21.78,12.6
>
> > model.anova<-aov(c~age*sex,data=data.sex)
> Error in eval(expr, envir, enclos) : object 'age' not found
>
>
>    i just wanna do a anova test. but the error message is as above,,,
>    what should i do to shoot this problem ? Should i define the age?
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Error-
> in-eval-expr-envir-enclos-object-not-found-tp3399503p3399503.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ) Error in eval(expr, envir, enclos) : object '' not found

mipplor
exactly,  i dont know why the header are  separated by invisible periods.  and it only happen to the header.

Reply | Threaded
Open this post in threaded view
|

Re: ) Error in eval(expr, envir, enclos) : object '' not found

David Winsemius

On Mar 23, 2011, at 5:35 PM, mipplor wrote:

> exactly,  i dont know why the header are  separated by invisible  
> periods.
> and it only happen to the header.

If it continues as a problem, it because you have not followed my  
advice from yesterday.

> --
> View this message in context: http://r.789695.n4.nabble.com/Error-in-eval-expr-envir-enclos-object-not-found-tp3399503p3400824.html

--

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ) Error in eval(expr, envir, enclos) : object '' not found

mipplor
thx , i have solved this by sep=","