Welcome to the Cookbook for R. The goal of the cookbook is to provide solutions to common tasks and problems in analyzing data.

Most of the code in these pages can be copied and pasted into the R command window if you want to see them in action.

  1. Basics
  2. Numbers
  3. Strings
  4. Formulas
  5. Data input and output
  6. Manipulating data
  7. Statistical analysis
  8. Graphs
  9. Scripts and functions
  10. Tools for experiments

R Graphics Cookbook

My book about data visualization in R is available! The book covers many of the same topics as the Graphs and Data Manipulation sections of this website, but it goes into more depth and covers a broader range of techniques. You can preview it at Google Books.

Purchase it from Amazon, or direct from O'Reilly.

This site is created by Winston Chang. It is not related to Paul Teetor’s excellent R Cookbook (Amazonlink).

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. The R code is freely available for use without any restrictions. In other words: you may reuse the R code for any purpose (and under any license), but if you want to reuse the other content of this website, you must adhere to the CC license.