How to learn R as a programming language

R

R Problem Overview


I'd like to know how to learn the R language as as 'programming' language as opposed to learning it as a statistical system. My question is prompted by lack of understanding of such functions as parse, eval, etc. which may not find frequent use by an R user with a 'statistics' persuasion.

Edit: I've been exploring such tools like Rpy RSPerl rJava and wish to (at the very least) be able to understand concepts that facilitate R's communication with other programming languages.

The availability of Web applications for R (R-PHP, RApache, etc.) is another motivationg factor for me to gain a deeper, more structural understanding of R.

Last but not the least, I'd like to be able to write R packages for which such understanding would be beneficial if not necessary.

R Solutions


Solution 1 - R

Solution 2 - R

A good book for learning R-as-a-programming-language (as opposed to R-for-statistics) is The Art of R Programming, by Norman Matloff.

enter image description here

It's very readable, doesn't assume you're a computer scientist, and is quite inexpensive as R books go.

Solution 3 - R

I would rather suggest a good and comprehensive start, like The R Book by Michael Crawley. It's an easy-to-read and complete book on R core functions, with statistical tips and a few exercises. It focuses a lot on R strengths (e.g. linear models) and gives also useful coding tricks. It helped me a lot while I was struggling on cryptic online courses.

alt text

Solution 4 - R

I'm a very hands-on learner, so this advice may be specific to my learning style. I would suggest that the best place to start "learning to program" in any language involves finding problems outside of your normal range of experience and then trying to solve them using a programming language.

The projects that taught me the most about how to program with R had nothing to do with statistics at all.

Knowing functions like parse() and eval() is by no means a measure for being "a good R programmer". Applications that require heavy use of these functions do not make up a majority of the problem space in which you can apply R. Instead, I think you should try to be "a good programmer" who knows R. This involves refining your problem-solving approaches.

Programming is not a spectator sport-- a good book is indispensable as a reference on the tools available, but you need to find some problems upon which to hone your skills.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionharshsinghalView Question on Stackoverflow
Solution 1 - RShaneView Answer on Stackoverflow
Solution 2 - Rgung - Reinstate MonicaView Answer on Stackoverflow
Solution 3 - RFederico GiorgiView Answer on Stackoverflow
Solution 4 - RSharpieView Answer on Stackoverflow