Thomas J. Leeper > Teaching > R Programming Course > Resources

R Resources

This page provides some resources for getting and using R. There are lots of these kinds of lists on the internet, so this one will show my own personal biases in terms of what is important. You are welcome to edit this page in order to initiate a pull request for any additions/deletions/edits.


Get R

You can get R at CRAN (the Comprehensive R Archive Network) for any of the usual operating systems.


Manuals and Introductions

CRAN provides a number of manuals and other resources for R, including:

  • An Introduction to R, a basic introduction for beginners. PDF HTML

  • The R Language Definition, a more technical discussion of the R language itself. PDF HTML

  • Writing R Extensions, a development guide for R. PDF HTML

  • R Data Import/Export, a data import and export guide. PDF HTML

  • R Installation, an installation guide (from R source code). PDF HTML

  • R Internals, internal structures and coding guidelines. PDF HTML

  • Contributed Documentation, from a number of authors

  • Task Views provide summaries of useful R packages by subject area

Other non-CRAN resources include:

  • The R Inferno by Patrick Burns provides some insight into common challenges beginners (and advanced users) face with R.

  • Quick-R provides some simple tutorials about an array of methods.

  • R-bloggers aggregates blog posts about R from all over the web.

  • I’ve written a short R introduction for undergraduates that may be helpful.

  • Teppei Yamamoto has some simple handouts for Princeton’s “Statistical Software Camp”.

  • Christopher Green’s somewhat old R Primer provides still useful information.


Resources for getting help

  • From within R, help and ? provide access to local help files.

  • help.search (in base R) and findFn (from the sos package) search for functions in all (installed and uninstalled) packages.

  • R mailing lists, especially the R-help list

  • R FAQ, the official list of FAQs on CRAN

  • StackOverflow, a question/answer site with a large R community

  • R Seek is a Google-powered search engine for R resources

  • And, ultimately, Google is your friend. I find that queries of the form “R CRAN [insert issue here]” generally give the best results rather than searching just “R [insert issue here]” given that “R” is one of the ten most frequent letters in the English language and many other European languages.


R Books

You can always find the latest R books on Amazon or wherever, but a couple that are useful (depending on your background):

The R Project also supplies a complete (?) list of R-related books.

For getting started with the reproducible research process, I might recommend:

The ReproducibleResearch Task View points to packages relevant for reproducible research.


Text editors for R

The following editors provide basic features like R syntax highlighting and some (like RStudio) provide more advanced features for R scripting and package development.

Internal to R there are also several options, including my own package rite, which provides a basic script editor and Rcmdr, which provides a heavier but more fully featured GUI.


R Packages

There are literally thousands of R packages on CRAN (the R community celebrated the 5000th package in November, 2013) and maybe dozens or hundreds more floating around the internet on places like GitHub, R-Forge, RForge.net, and OmegaHat.

It can sometimes be hard to find the right packages but Googling and use of the Task Views usually get you what you need. That said, beginners, in particular, may find John Fox’s car package helpful for doing a bunch of regression-type analyses beyond what’s provided in base R. Gary King (et al.)’s Zelig software also provides a somewhat more consistent interface than base R to a bunch of R modelling functions (especially those written by King and coauthors, not surpisingly). Zelig also provides the functionality of Clarify, familiar to many Stata users for its predicted probability functionality.


R Graphics

R basically offers three completely incompatible graphics approaches.

  • Base R, which encompasses all of the graphics functionality provided with the default R packages and add-ons to those approaches.

  • Lattice, a different approach with a bunch of add-on packages that makes graphs some people consider attractive

  • ggplot2, a really huge graphics library with an even larger set of add-ons. ggplot2 undergoes constant development, has a huge community of users, is the basis for several books, and generally makes graphs that many people consider attractive using a consistent design “grammar” that requires you to fundamentally rethink the relationship between data and visualization.

The choice among these alternatives approaches depends largely on what you want to do and how you think about graphics. I am a dedicated base R graphics user, but I occasionally see advantages to ggplot2 (especially in the area of GIS).

For mapping and geographic visualization, the Spatial Task View offers links to most relevant resources.


Some more advanced resources