I strongly recommend Michael Crawley's The R Book. A bit expensive,
but absolutely worth it. It is nearly 900 pages and covers everything
from data structures to character string manipulation to stats. There
may be better books out there, but I haven't seen them. As an aside,
Crawley has
I will second Dan's sentiment here: I haven't found a single source
which comprehensively lays out the programming framework for R (though
I've never seen The R Book). I ended up learning (and still am
learning) how to program R in a relatively piecemeal manner. Some of
the references which
Venables and Ripley (2002) Modern Applied Stats with S, Springer and, in
particular, Venables and Ripley (2000) S Programming, Springer, are two
good resources for picking up tips, features of the language etc,
especially the latter.
Those looking at programming in R might also take a look at