[R] ISO R-programming docs/refs

Kuhn, Max Max.Kuhn at pfizer.com
Mon Oct 17 14:52:49 CEST 2005


KJ,

>In my job I write custom computer programs for data analysis, which
>are used in our company's consulting business.  Whenever I've needed
>statistical analyses I've coded the algorithms myself, but my boss
>wants me to start learning and using R, to speed up development.
>

I'm curious as to what language you usually use. That might help us 
help you in terms of language differences.

>I am very reluctuant to do this because I can't find adequate
>*programming* documentation for R (though I can find a lot of
>inadequate documentation).  As far as I can tell, the R documentation
>may be adequate for end-users who don't plan to do much programming
>(if any at all), but it is completely unacceptable from the standpoint
>of programming.
>

While I would agree that almost every statistical programming language
spend more time on context-specific information (e.g. here's the code
to get a regression line) than good coding practices (program design
and layout), I think that you've misjudged the documentation. 

Sources to learn (in no particular order):

1). S programming by Venables and Ripley, especially section 7.7

2). The code itself! Download the sources from cran (I believe the 
   installed packages have comments stripped). There is a ton of code 
   out there and you will learn just as much from the great code 
   examples as you will from the bad ones (and there are some bad ones).

3). The manuals at http://cran.r-project.org/manuals.html. For example,
   your list subscripting solution is plainly demonstrated in section 6.1:
   
    "Thus if Lst is the name of a list with four components, these may
    be individually referred to as Lst[[1]], Lst[[2]] ..."

4). Package vignettes. There are many packages with doc directories
   with pdf documents that explain some of the nuances of the 
   package. This will help you learn the language.
   
5). For "questions about the programming language itself" it would
   seem like the R Language Definition manual might go a long way.
   
6). This list already contains many answers to common questions

7). Misc web sites:

   - the site listed in http://www.bioconductor.org/workshops/
     typically have sections for an introduction to R

   - Dr. Harrell's site at 
     http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/

   - JHU's statistical computing class:
     http://www.biostat.jhsph.edu/~bcaffo/statcomp/

   - google 

8). R news, http://cran.r-project.org/doc/Rnews, has two sections
   that may be of interest "Programmer's Niche: nifty hints for 
   programming in R (or S)" and "Hints for newcomers: Explaining 
   sides of R that might not be so obvious from reading the manuals 
   and FAQs."

9). The useR conferences have presentations that might be of interest
   to you: http://www.ci.tuwien.ac.at/Conferences/useR-2004/. I
   would check out the keynote lecture by Martin Mächler.
   
>In a couple of simple exploratory projects I have been reduced to
>programming by *trial and error*.  For example, I just spent a couple
>of fruitless hours trying to find information on how to modify a list
>(all my ***guesses*** have failed; they either produce results
>different from what I want, or generate errors such as "replacing
>element in non-existent column").  How much fundamental basic can one
>get in the documentation of a programming language than this sort of
>information?[1]  This is just one of many examples.  My R code is filled
>with crude hacks that I don't understand, and that I stumbled upon in
>blind scrambles to get my code to work.  How can I possible stand by
>the results of my R scripts if they are the product of sheer
>guesswork?
>

Remember that R is a language created, maintain and grown by
volunteers. 

There is no company that pays people to write copious amounts 
of documentation (like SAS, S-Plus, Java etc). I think that if you 
are going to use R, you should accept the limitations that you 
perceive - and honestly, I don't think that you've put enough effort 
into learning it. 

If you do get stuck, search R-help, read the posting guide, 
compose an email with a very specific question, read the posting 
guide again and send it in. 

(and since they are volunteers, you should also be nice to them.)

>I even bought the R Reference Manual, vols. 1 and 2, and deeply regret
<snip>

Max Kuhn
Associate Director 
Nonclinical Statistics
Pfizer Global R&D

----------------------------------------------------------------------
LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}




More information about the R-help mailing list