John Mount from Win-Vector LLC gave a very interesting and entertaining talk at this week's Bay Area User Group Meeting, with seven tips for "surviving" R (based on a post on his blog). His recommendations include:
- Keep extensive written notes
- Find a way to search for R answers
- Learn to convert complex objects to canonical forms with unclass()
- Learn how to find and inspect classes and methods for objects
- Learn how to clear pesky attributes from objects
- Swallow your pride (which I interpret as the equivalent to Tim Gunn's "Make it work!")
- and learn and use R's many one-line idioms, rather than reinventing the wheel.
It's always interesting to me how people approach the R language differently, and especially for those coming to R for languages where concepts like classes and attributes can seem a little arcane in R, this is a good guide for escaping some of those early "gotcha" moments. Check out all the details in the post linked below.
Win-Vector Blog: Survive R
David, you gave a great talk yourself. Also, the reason there were absolutely no debugging hints in my list is: prior to seeing your demo I was fairly certain there was no point in using R's debugging facilities (the impossible task (the nearly impossible task of "just getting it right" seemed easier than dealing with the standard R debugging tools). After seeing your demo and product I am pretty excited about adding interactive debugging to my R programming repertoire.
Posted by: John Mount | October 15, 2009 at 11:00
I'm pleased to hear about more and better debugging utilities making their way towards R's core, and I think that overall REvolution Computing's dual-level model of using paid support to fund open source development is a great one. A similar system has driven postgresql's development rapidly forwards, for example.
At present, my most effective bug-fighting ally is setting error and warning options in .Rprofile. For identifying typos and simple confusions, an inspection of the traceback is usually sufficient:
require(utils)
options(error=recover) ## requires utils package
options(warn=2) ## sometimes this is overkill, but often invaluable
Posted by: Christian Gunning | October 16, 2009 at 19:01
Your post is really interesting but I enjoyed reading comments on your post more than your post. It's true. I really appreciate your work and appreciate you.
Posted by: gadgets | October 24, 2009 at 05:31