[R] Learning ANOVA

Liaw, Andy andy_liaw at merck.com
Fri Aug 13 18:48:33 CEST 2010


From: Stephen Liu
> 
> Hi folks,
> 
> R on Ubuntu 10.04 64 bit.
> 
> Performed following steps on R:-
> 
> ### to access to the object
> > data(InsectSprays)
> 
> ### create a .csv file
> > write.csv(InsectSprays, "InsectSpraysCopy.csv")
> 
> 
> On another terminal
> $ sudo updatedb
> $ locate InsectSpraysCopy.csv
> /home/userA/InsectSpraysCopy.csv
> 
> 
> ### Read in some data
> > test01 <- read.csv(file.choose(), header=TRUE)
> 
> Enter file name: /home/userA/InsectSpraysCopy.csv
> 
> 
> ### Look at the data
> > test01
>     X count spray
> 1   1    10     A
[snipped]

Note the names of the variables here.  They don't match what you tried
to use in your boxplot() call below.  Where did you get the idea that
there are "DO" and "Stream" in the "test01" data frame?

Andy

 
> ### Create a side-by-side boxplot of the data
> boxplot(test01$DO ~ test01$Stream)
> Error in model.frame.default(formula = test01$DO ~ test01$Stream) : 
>   invalid type (NULL) for variable 'test01$DO'
> 
> 
> I was stucked here.  Pls help.  TIA
> 
> 
> B.R.
> Stephen L
> 
> 
> 
> ----- Original Message ----
> From: Stephen Liu <satimis at yahoo.com>
> To: r-help at r-project.org
> Sent: Fri, August 13, 2010 11:34:31 AM
> Subject: [R] Learning ANOVA
> 
> Hi folks,
> 
> 
> File to be used is on;
> data(InsectSprays)
> 
> 
> I can't figure out where to insert it on following command;
> test01 <- read.csv(fil.choose(), header=TRUE)
> 
> Please help.  TIA
> 
> B.R.
> 
> 
> 
> 
> ______________________________________________
> 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.
> 
> 
> 
> 
> ______________________________________________
> 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.
> 
Notice:  This e-mail message, together with any attachme...{{dropped:11}}



More information about the R-help mailing list