[Rd] Working on a Vignette called Rcheology

From: Paul Johnson <pauljohn32_at_gmail.com>
Date: Tue, 12 Jun 2012 15:14:38 -0500


Greetings, R developers

Here are my requests today.

  1. Would you care to review this vignette http://pj.freefaculty.org/R/Rchaeology.pdf and tell me if you think it is wrong headed, and
  2. Supposing you do not think I'm completely wrong, would you care to point me at more examples of R idioms that lead to deep insights into the nature of R programming?

Longer more boring explanation:

In the rockchalk package, I have functions to make it easier to teach regression to students who aren't R programmers. I just uploaded package version 1.6 to CRAN. While I do this, I'm reading R source code all the time because I need to understand how functions like summary and anova receive R objects, take them apart, and do specific chores. I've been very glad that R is open source while I do this.

While working on this, an inspiration hit me! I want to call "Rchaeology" the study of R idioms and customs deduced from the R source code written by the experts. Practicing this makes me an Rchaeologist.

I've started a vignette, it's in rockchalk and up here:

http://pj.freefaculty.org/R/Rchaeology.pdf

I plan to work out sections that explore some particular usage examples that touch on things that expose special features of the R language. Right now, I've only got one worked out, it explores this idiom that Gabor G. explained to me, which receives a formula object and replaces a variable "x1" with "x1c".

do.call("substitute", list(newFmla, setNames(list(as.name("x1c")), "x1")))

I think that one is fabulous, It sheds a lot of light when you break it down to pieces.

I'd like to build up a good list of "Do This, Not That" bits, but it is hard to find particular approaches that almost all of you will agree to. Almost everybody agrees that calling rbind over and over again is slow, and do.call with rbind and a collection of stackable things is better:

http://pj.freefaculty.org/R/WorkingExamples/stackListItems.R

If you have ideas for "Do This, Not That", I'd be glad to hear them and I'll look for example applications that make them relevant.

pj

-- 
Paul E. Johnson
Professor, Political Science    Assoc. Director
1541 Lilac Lane, Room 504     Center for Research Methods
University of Kansas               University of Kansas
http://pj.freefaculty.org            http://quant.ku.edu

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 12 Jun 2012 - 21:17:25 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Jun 2012 - 22:50:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive