[R] R: Tools for thinking about data analysis and graphics

Greg Snow Greg.Snow at imail.org
Thu Oct 7 19:00:37 CEST 2010


I think that R/S's biggest advantage is in the ways you can store data.  It does not force you to fit your data to a single spreadsheet like table, but rather encourages you to think about your data and find the correct way to store it.  Lists and objects are a great advantage for keeping related things combined together.  I can have multiple data sets available all at the same time, but still in separate objects.

Also the results of routines can be kept in a way that makes working with them easy.  I remember working with programs that just had one big spreadsheet and ending up with 3 different columns of residuals from 3 different models, but then forgot which residuals matched which model.  With R/S each lm object has the residuals stored with it including the call to remind us what model and options were used.  One plot that I like to make when exploring different models is:

> plot( fitted(model1), fitted(model2) ); abline(0,1)

That is simple and straight forward in R/S, but much more difficult in other programs.


I also like the fact that the graphics system will let me create anything I want.  There are tools to create the standard plots (and I really like the simplicity of calling plot on an lm object and getting a standard set of diagnostics), but there are also the tools to create any plot I can imagine, or add any information I feel useful to an existing plot.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Michael Friendly
> Sent: Wednesday, October 06, 2010 3:06 PM
> To: R-help
> Subject: [R] R: Tools for thinking about data analysis and graphics
> 
>   I'm giving a talk about some aspects of language and conceptual tools
> for thinking about how
> to solve problems in several programming languages for statistical
> computing and graphics. I'm particularly
> interested in language features that relate to:
> 
> o expressive power: ease of translating what you want to do into the
> results you want
> o elegance: how well does the code provide a simple human-readable
> description of what is done?
> o extensibility: ease of generalizing a method to wider scope
> o learnability: your learning curve (rate, asymptote)
> 
> For R, some things to cite are (a) data and function objects, (b)
> object-oriented methods (S3 & S4); (c) function mapping over data with
> *apply methods and plyr.
> 
> What other language features of R should be on this list?  I would
> welcome suggestions (and brief illustrative examples).
> 
> -Michael
> 
> 
> --
> Michael Friendly     Email: friendly AT yorku DOT ca
> Professor, Psychology Dept.
> York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
> 4700 Keele Street    Web:   http://www.datavis.ca
> Toronto, ONT  M3J 1P3 CANADA
> 
> ______________________________________________
> 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.



More information about the R-help mailing list