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 (Amazon link).

The code examples on this site are available for use under the CC0 license. All other content is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.