[R] Learning ANOVA
David Winsemius
dwinsemius at comcast.net
Sat Aug 14 11:44:00 CEST 2010
On Aug 14, 2010, at 3:38 AM, JesperHybel wrote:
>
>> JH .how to plot 4 graphs simultaneously?
>
> Depends on what graphs were talking about: A Side-by-side boxplot
> containing
> fx 4 boxplots can be generated by a single plot() command. However
> often you
> use a primary command that activivates
> the plot window and plots one graph, then afterwards you use secondary
> commands to add new graphical objects to the same graph/window:
>
> x<-c(1,2,3,4)
> y<-c(1,2,3,4)
> plot(x,y) #primary graphical command activates plot window
> abline(-1,3) # adds line
> points(c(1,2),c(2,2),col="red",pch=16) #adds points
>
>
Apparently JesperHybel was writing in response to a question by
Stephen Liu (aka satimis when viewed on Nabble) on Aug 13, 2010;
11:04pm:
>> JH > Also how to save InsectSprays.aov? I think I can only save it
>> as
>> InsectSprays.csv. I can't find "write.aov" command.
If you want to save an R object such as that returned by a function
like aov, there are several ways. The save() function will create a
compacted form that can then be read back into an R session with
load(). The dump() and dput() functions will turn an object into an
ASCII representation that can be saved as a text file. If you only
want to have the text that is produced when you "print" it (and this
is what you implicitly get when to just call the function at the
console), then use sink() or capture.output().
>
> "InsectSprays.aov" is an object - in this case probably a list.
Not "probably"; it is a list. Look at it with str if you have questions.
> If you make
> an assignment using
> the assignment operator '<-' to an object not already existing in
> you're
> current work session
> R will create that object.
> Or to put it differently: "InsectSprays.aov" is only a name you
> might as
> well have called it
> "HomeGrownMagic" or "McDonalds" - the "aov" in the name is not to be
> mistaken for a file
> extension. The name only surves the purpose to remind you what it is a
> container of namely
> an ANOVA output of the variables Insect and Spray, that helps you
> not youre
> computer.
>
> There are different ways to save: You can store the whole worksession,
> thereby storing all the
> objects you have created during worksession and have not removed. Or
> you can
> sink particular objects
No, you cannot sink objects. You sink console output.
>
> I recommend that you have a look at:
> http://cran.r-project.org/doc/contrib/Verzani-SimpleR.pdf
>
> Very well written, want tell you all you want to know but will not
> drown you
> in computer lingo
> and tie you down with details. Gives you some hands on experience
> handling
> the most basic plots
> and objects in R. If you later want to buy Verzanis book grown from
> the
> freely available notes you
> go wrong there either, basically more of the same.
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Learning-ANOVA-tp2323660p2325057.html
> Sent from the R help mailing list archive at Nabble.com.
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list