R can be confusing when you’re first starting out, especially when you don’t have any experience in programming. There’s a lot of documentation online, and package developers do a decent job at providing examples on how to use their work in your code, but that stuff is not always easy to find. It’s easy if you know the name of the package or function you’re looking for. However, most of the time you just know what you want to do—like sort a data frame or test a regression model—and not the name of a package.
The R Cookbook by developer Paul Teetor might be your answer.
From the book description:
This collection of concise, task-oriented recipes makes you productive with R immediately, with solutions ranging from basic tasks to input and output, general statistics, graphics, and linear regression.
There are 14 chapters and around 400 pages. One third covers the basics of R, such as setting variables; one half covers analysis tools such hypothesis testing and linear regression; the rest covers miscellaneous topics. There’s one chapter on creating graphics.
Those who have used other O’Reilly cookbooks will recognize the format right away. Sections are organized by recipe with a problem, solution, and discussion. Most recipes are pretty short, around one or two pages.
In short, R Cookbook is basically what I expected. This is a good thing, as O’Reilly cookbooks are usually pretty useful. The recipes are straightforward to follow and the text is an easy read. There’s some discussion at the beginning of each chapter about statistical methods, such as what p-values mean, but don’t expect a full-on guide on statistical analysis (not that it claims to be one).
What this book will provide are steps that can help you with the early stages of getting up and running to the more advanced functions for probability, general statistics, and time series analysis.
For those who already use R, the R Cookbook can be a handy reference when Google lets you down. I imagine those who are familiar with statistical methods but use different software like SAS will also find this useful. If, however, you’re looking for a book that’s more visualization-based or you’re new to statistics, you will probably want to look elsewhere.