Authors of books on R use multiple "book writing" strategies. Some authors cover way too many
packages. Some limit themselves to a few. Same have many different examples Others use the same
example in many chapters. Much of the value of the book for particular reader comes from
matching background and topics covered. As such there is not and can't be the "best" book for all
readers. You need to chose the book hat suit your needs best.
Also most of the books on R have recipe flavor -- they show how something is done in R and that's
it. So if a particular book is close to the area where you plan to use R (for example, technical
analysis) it is a distinct plus as most probably it will cover those things that are necessary for
programming in this domain in
more details then other R books.
The R
book by Michael J. Crawley. One of the few attempt to cover R as the language, not as the
set of recipes. Chapter 2 contains one of the best overview of the language.
The R
book. by Michael J. Crawley is one of the few attempt to cover R as the language, not as the
set of recipes. This is a big book, over 1K pages, and I think 1K pages is the minimal amount in
which you can cover the R language in some detail.
Writing a book on a complex and powerful scripting language
such as R is a daunting task and requires several iteration. That's what we have in this book. first
edition was actionlly the second as the content of this book was similar to an earlier book
by the same author (Statistical Computing: An Introduction to Data Analysis using S-Plus). So the
second edition can be viewed as the third edition.
Writers of the "language book" need to carefully consider
their audience (which now for the most part knows some Java and possibly Python) and clearly state
how features of the language really work and not to fall in a typical for books about R recipe
approach. This is a very difficult task and the author did a good job in this area which makes the
book outstanding. Chapter 2 contains one of the best overview of the language.
You will be disappointed if you are a competent R programmer looking for "hacks". Note that
the only negative review so far mentions its author's four-year experience with R. Mine is much
shorter, yet I too find the book too "junior" for my needs. (With "R in Nutshell" and Google at
my disposal, I can send "R Cookbook" back after making several notes to record what I learnt from
it. There are several nuggets that you will not find in "R in Nutshell", or will not think to
google). However, the book is not advertised as an "R in Depth", so no complaints.
"R Cookbook" is a friendly and highly informative introduction to "general-purpose" R (one half
of the book) and doing basic statistics with R (the other half). A chapter on time series, with
a look at "zoo" package, is a bonus; a somewhat light (but does-the-job) take on R graphics may
be viewed as a downside, but I see the benefit of getting the basics right, and letting the reader
explore other resources - I would recommend "R Graphs Cookbook" and Quick-R Web site - when he/she
is ready.
Yes, there are free R tutorials out on the Web - but given that this one is widely praised and
inexpensive (even if you are never going to resell it - and at some point you probably should,
and move to "R in Nutshell" - $25 is not too much. How much saved time is worth $25 for you?),
why not take a look?
PS. "R in Action" by Robert Kabacoff is another option, and one that I actually like better.
PPS. The second edition of Michael Crawley's "R Book" is a large improvement over the first, and
is a stronger competitor to both "R Cookbook" and "R in Action".
R for Everyone by
By Jared P. Lander is a good introductory book for non-programmers. Has little
value for programmers proficient in Perl or other scripting languages. It is almost 500 pages
long, half-the length of R book and this shows.
Again this book is not for everyone. It's only good for absolute beginners. This book is basically 2-distinct books: The first 13-chapters are the basics of
R. They are OK only if you are new to R.
The book "R for everyone" has many positive reviews on Amazon.
Among advantages of the book that are sited in reviews are
It covers RStudio and ggplot2 in some details.
Chapters are
short and can be converted to lessons using one chapter one lesson principle.
The author used to
teach a course at Columbia, which is a plus, but the standard of coverage of programming language
in this book is very low as this is book mainly directed toward non professionals.
Unfortunately the author provides only minimal online
resources at http://www.jaredlander.com/r-for-everyone/
(no code examples was posted by the author which is "big no" and signifies the lack of respect for
readers ):
Pearson has posted
Chapter 12 “Data Reshaping”, online for free.
The idea to provide 80% of functionality by explaining only 20% of the language is great, but
it's implementation if far from perfect. The book feels rushed. Examples can definitely be
polished more and made more useful by using them in different chapters. Currently chapters look
isolated. Still it is OK for beginners who
does not have a programming experience in any language, but even in this case there might be better books.
For an introductory book the author introduces way too many packages. Used examples that are way too diverse and generally
do not care about consistency from one chapter to another. I do not recommend this book for people who already know other scripting language such as Perl.
The R
book by Michael J. Crawley is a better deal.
The Art
of R Programming is a pretty short book (400 pages only) oriented on people who already
know programming in some other language.
Paperback: 400 pages
Publisher: No Starch Press; 1 edition (October 15, 2011)
Language: English
ISBN-10: 1593273843
This book concentrates on essentials of the R language itself and contains well-chosen
examples that illustrate the concepts involved (as opposed to focusing on statistics or data
analysis). If covers such rarely addressed in R books concepts as
Variable scope - Chapter 7
Debugging - Ch 13
(Older free version is available as PDF, so you can get pretty accurate
impression about the book by reading the PDF). This is more systematic approach to the language that
in other books.
As you can read older version online you can get solid understanding of what book is about
and the style of the author.
An essential guide to the trouble spots and oddities of R. In
spite of the quirks exposed here, R is the best computing environment for most data analysis tasks.
Google Developers' Intro to R. This series of 21 short YouTube videos includes some
basic R concepts, a few lessons on reshaping data and some info on loops. In addition, six videos
focus on a topic that's often missing in R intros: working with and writing your own functions. This
YouTube playlist offers a good programmer's introduction to the language -- just note that if you're
looking to learn more about visualizations with R, that's not one of the topics covered.
Introduction
to Data Science with R. At $160 this O'Reilly training course is somewhat pricey considering
how many free and lower-cost video classes there are out there. However, if you're looking for
a step-by-step intro to R, this is a useful course, starting with language and ggplot2 visualization
basics through modeling. It's taught by RStudio Master Instructor Garrett Grolemund, who focuses
on hands-on learning as well as explaining a few of the language's quirks. If cost is an issue and
you're not in a hurry, sign up for O'Reilly's deal emails and you may eventually find a 50% off
sale. Also available from O'Reilly Safary unlimited. --[NNB]
Data Analysis and Visualization
Using R. Free course that uses both video and interactive R to teach language basics, ggplot2
visualization basics, some statistical tests and exploratory data analysis including data.table.
Videos by Princeton Ph.D. student David Robinson and Neo Christopher Chung, Ph.D, filmed and edited
at the Princeton Broadcast Center.
This list was originally published as part of the
Computerworld Beginner's Guide to R but has since been expanded to also include resources
for advanced beginner and intermediate users. If you're just starting out with R, I recommend first
heading to the
Beginner's Guide.
Want to see a sortable list of resources by subject and type? Expand the chart below. You can
also search for key terms within the chart by using the search box below.
R Cookbook. Like the rest of the O'Reilly Cookbook series, this one offers
how-to "recipes" for doing lots of different tasks, from the basics of R installation and creating
simple data objects to generating probabilities, graphics and linear regressions. It has the added
bonus of being well written. If you like learning by example or are seeking a good R reference
book, this is well worth adding to your reference library. By Paul Teetor, a quantitative
developer working in the financial sector.
R Graphics Cookbook. If you want to do beyond-the-basics graphics in R, this is a useful
resource both for its graphics recipes and brief introduction to ggplot2. While this goes way
beyond the graphics capabilities that I need in R, I'd recommend this if you're looking
to move beyond advanced-beginner plotting. By Winston Chang, a software engineer at RStudio.
R in Action: Data analysis and
graphics with R. This book aims at all levels of users, with sections for beginning, intermediate
and advanced R ranging from "Exploring R data structures" to running regressions and conducting
factor analyses. The beginner's section may be a bit tough to follow if you haven't had any
exposure to R, but it offers a good foundation in data types, imports and reshaping once
you've had a bit of experience. There are some particularly useful explanations and examples for
aggregating, restructuring and subsetting data, as well as a lot of applied statistics. Note that
if your interest in graphics is learning ggplot2, there's relatively little on that here compared
with base R graphics and the lattice package. You can see an excerpt from the book online:
Aggregation and restructuring data. By Robert I. Kabacoff.
The Art of R Programming. For those who want to move beyond using R "in an ad hoc way
... to develop[ing] software in R." This is best if you're already at least moderately proficient
in another programming language. It's a good resource for systematically learning fundamentals
such as types of objects, control statements (unlike many R purists, the author doesn't actively
discourage for loops), variable scope, classes and debugging -- in fact, there's nearly as large
a chapter on debugging as there is on graphics. With some robust examples of solving real-world
statistical problems in R. By Norman Matloff.
R in a Nutshell. A reasonably readable guide to R that teaches the language's fundamentals
-- syntax, functions, data structures and so on -- as well as how-to statistical and graphics
tasks. Useful if you want to start writing robust R programs, as it includes sections on functions,
object-oriented programming and high-performance R. By Joseph Adler, a senior data scientist
at LinkedIn.
Visualize This.
Note; Most of this book is not about R, but there are several examples of visualizing
data with R. And there's so much other interesting info here about how to tell stories with data
that it's worth a read. By Nathan Yau, who runs the popular
Flowing Data blog and whose doctoral dissertation
was on "personal data collection and how we can use visualization to learn about ourselves."
Introduction to Data Science. It's highly readable, packed with useful examples and
free -- what more could you want? This e-book isn't technically an "R book," but it uses R for
all of its examples as it teaches concepts of data analysis. If you're familiar with that topic
you may find some of the explanations rather basic, but there's still a lot of R code for things
like analyzing tweet rates (including a helpful section on how to get Twitter OAuth authorization
working in R), simple map mashups and basic linear regression. Although Stanton calls this an
"electronic textbook," Introduction to Data Science has a conversational style that's pleasantly
non-textbook like. There used to be a downloadable PDF...
R for Everyone. Author Jared P. Lander promises to go over "20% of the functionality
needed to accomplish 80% of the work." And in fact, topics that are actually covered, are
covered pretty well; but be warned that some items appearing in the table of contents can be a
little thin. This is still a well-organized reference, though, with information that beginning
and intermediate users might want to know: importing data, generating graphs, grouping and reshaping
data, working with basic stats and more.
Statistical Analysis With R: Beginner's Guide. This book has you "pretend" you're a strategist
for an ancient Chinese kingdom analyzing military strategies with R. If you find that idea hokey,
move along to see another resource; if not, you'll get a beginner-level introduction to various
tasks in R, including tasks you don't always see in an intro text, such as multiple linear regressions
and forecasting. Note: My early e-version had a considerable amount of bad spaces in my Kindle
app, but it was still certainly readable and usable.
Reproducible Research with R and RStudio. Although categorized as a "bioinformatics" textbook
(and priced that way - even the Kindle edition is more than $50), this is more general advice
on steps to make sure you can document and present your work. This includes numerous sections
on creating report documents using the knitr package, LaTeX and Markdown -- tasks not often covered
in-depth in general R books. The author has posted
source code for generating
the book on GitHub, though, if you want to create an electronic version of it yourself.
Exploring Everyday Things with R and Ruby. This book oddly goes from a couple of basic
introductory chapters to some fairly robust, beyond-beginner programming examples; for those
who are just starting to code, much of the book may be tough to follow at the outset. However,
the intro to R is one of the better ones I've read, including lot of language fundamentals and
basics of graphing with ggplot2. Plus experienced programmers can see how author Sau Sheong Chang
splits up tasks between a general language like Ruby and the statistics-focused R.
Cookbook for R. Not to be
confused with the R Cookbook book mentioned above, this website by software engineer
Winston Chang (author of the R Graphics Cookbook) offers how-to's for tasks such as data
input and output, statistical analysis and creating graphs. It's got a similar format to an O'Reilly
Cookbook; and while not as complete, can be helpful for answering some "How do I do that?" questions.
Quick-R. This site has a
fair amount of samples and brief explanations grouped by major category and then specific items.
For example, you'd head to "Stats" and then "Frequencies and crosstabs" to get an explainer of
the table() function. This ranges from basics (including useful how-to's for customizing R startup)
through beyond-beginner statistics (matrix algebra, anyone?) and graphics. By Robert I. Kabacoff,
author of
R in Action.
R Reference
Card. If you want help remembering function names and formats for various tasks, this
4-page PDF is quite useful despite its age (2004) and the fact that a link to what's supposed
to be the latest version no longer works. By Tom Short, an engineer at the Electric Power
Research Institute.
A short
list of R the most useful commands. Commands grouped by function such as input, "moving
around" and "statistics and transformations." This offers minimal explanations, but there's also
a link to a longer guide to Using
R for psychological research. HTML format makes it easy to cut and paste commands. Also somewhat
old, from 2005. By William Revelle, psychology professor at Northwestern University.
Chart Chooser
in R. This has numerous examples of R visualizations and sample code to go with them,
including bar, column, stacked bar & column, bubble charts and more. It also breaks down the visualizations
by categories like comparison, distribution and trend. By Greg Lamp, based on
Juice Labs' Chart
Chooser for Excel and PowerPoint.
R Graph Catalog.
Lots of graph and other plot examples, easily searchable and each with downloadable code. All
are made with ggplot2 based on visualization ideas in
Creating More Effective Graphs. Maintained by Joanna Zhao and Jennifer Bryan.
Beautiful Plotting in R: A ggplot2 Cheatsheet. Easy to read with a lot of useful information,
from starting with default plots to customizing title, axes, legends; creating multi-panel plots
and more. By Zev Ross.
Frequently Asked
Questions about R. Some basics about reading, writing, sorting and shaping data as well
as a lineup of how to do various statistical operations and a few specialized graphics such as
spaghetti plots. From UCLA's Institute for Digital Research and Education.
R Reference Card for Data Mining. This is a task-oriented compilation of useful R packages
and functions for things ranging from text mining and time series analysis to more general subjects
like graphics and data manipulation. Since decriptions are somewhat bare-boned, this will likely
be more useful to either remind you of functions you've seen before or give you suggestions for
things to try. For much more on the subject, head to the author's
R and Data Mining website, which includes
examples and other documentation. including a substantial portion of his book R and Data Mining
published by Elsevier in 2012. By Yanchang Zhao.
Spatial Cheat Sheet. For those doing GIS and spatial analysis work, this list offers some
key functions and packages for working with spatial vector and raster data. By Barry Stephen
Rowlingson at Lancaster University in the U.K.
Online tools
Web interface for ggplot2.
This online tool by UCLA Ph.D. candidate Jeroen Ooms creates an interactive front end for ggplot2,
allowing users to input tasks they want to do and get a plot plus R code in return. Useful for those
who want to learn more about using ggplot2 for graphics without having to read through lengthy documentation.
Twotorials. You'll either
enjoy these snappy 2-minute "twotorial" videos or find them, oh, corny or over the top. I think they're
both informative and fun, a welcome antidote to the typically dry how-to's you often find in statistical
programming. Analyst Anthony Damico takes on R in 2-minute chunks, from "how to create a variable
with R" to "how to plot residuals from a regression in R;" he also tackles an occasional problem
such as "how to calculate your ten, fifteen, or twenty thousandth day on earth with R." I'd strongly
recommend giving this a look if textbook-style instruction leaves you cold.
Sample "Twotorial" video.
Google Developers' Intro to R. This series of 21 short YouTube videos includes some
basic R concepts, a few lessons on reshaping data and some info on loops. In addition, six videos
focus on a topic that's often missing in R intros: working with and writing your own functions. This
YouTube playlist offers a good programmer's introduction to the language -- just note that if you're
looking to learn more about visualizations with R, that's not one of the topics covered.
This video in the Google Developers' R series introduces functions in R.
Up and
Running with R. This lynda.com video class covers the basics of topics such as using the
R environment, reading in data, creating charts and calculating statistics. The curriculum is limited,
but presenter Barton Poulson tries to explain what he's doing and why, not simply run commands. He
also has a more in-depth 6-hour class,
R Statistics Essential Training. Lynda.com is a subscription service that starts at $25/month,
but several of the videos are available free for you to view and see if you like the instruction
style, and there's a 7-day free trial available.
Coursera: Computing for
Data Analysis. Coursera's free online classes are time-sensitive: You've got to enroll while
they're taking place or you're out of luck. However, if there's no session starting soon, instructor
Roger Peng, associate professor of biostatistics at Johns Hopkins University,
posted his lectures
on YouTube; Revolution Analytics then collected them on a
handy
single page. While I found some of these a bit difficult to follow at times, they are packed
with information, and you may find them useful.
Intro video for the Coursera Computing for Data Analysis course
Coursera: Data Analysis. This was more of an applied statistics class that uses R as opposed
to one that teaches R; but if you've got the R basics down and want to see it in action, this might
be a good choice. There are no upcoming scheduled sessions for this at Coursera, but instructor Jeff
Leek -- an assistant professor of biostatistics at Johns Hopkins,
posted his lecture videos on YouTube, and
Revolution Analytics collected links to them all by week.
Intro video for Coursera Data Analysis online class
Coursera: Statistics One
If you don't mind going through a full, 12-week stats course along with learning R, Princeton University
senior lecturer Andrew Conway's class includes an introduction to R. "All the examples and assignments
will involve writing code in R and interpreting R output," says the course description. You can check
the Coursera link to see if and when future sessions are scheduled.
Introduction
to Data Science with R. At $160 this O'Reilly training course is somewhat pricey considering
how many free and lower-cost video classes there are out there. However, if you're looking for
a step-by-step intro to R, this is a useful course, starting with language and ggplot2 visualization
basics through modeling. It's taught by RStudio Master Instructor Garrett Grolemund, who focuses
on hands-on learning as well as explaining a few of the language's quirks. If cost is an issue and
you're not in a hurry, sign up for O'Reilly's deal emails and you may eventually find a 50% off
sale. Also availble from O'Reilly Safary unlimited. --[NNB]
Data Analysis and Visualization
Using R. Free course that uses both video and interactive R to teach language basics, ggplot2
visualization basics, some statistical tests and exploratory data analysis including data.table.
Videos by Princeton Ph.D. student David Robinson and Neo Christopher Chung, Ph.D, filmed and edited
at the Princeton Broadcast Center.
Other online introductions and tutorials
Try R This beginner-level interactive
online course will probably seem somewhat basic for anyone who has experience in another programming
language. However, even if the focus on pirates and plunder doesn't appeal to you, it may be a good
way to get some practice and get more comfortable using R syntax.
An Introduction
to R. Let's not forget the R Project site itself, which has numerous resources on the language
including this intro. The style here is somewhat dry, but you'll know you're getting accurate, up-to-date
information from the R Core Team.
How to Visualize and Compare Distributions. This short and highly readable Flowing
Data tutorial goes over traditional visualizations such as histograms and box plots. With downloadable
code.
Handling and Processing Strings in R. This PDF download covers many things you're
want to do with text, from string lengths and formatting to search and replace with regular expressions
to basic text analysis. By statistician Gaston Sanchez.
Learning
statistics with R: A tutorial for psychology students and other beginners by Daniel Navarro
at the University of Adelaide (PDF). 500+ pages that go from "Why do we learn statistics" and "Statistics
in every day life" to linear regression and ANOVA (ANalysis Of VAriance). If you don't need/want
a primer in statistics, there are still many sections that focus specifically on R.
R Tutorial. A reasonably
robust beginning guide that includes sections on data types, probability and plots as well as sections
focused on statistical topics such as linear regression, confidence intervals and p-values. By Kelly
Black, associate professor at Clarkson University.
Aggregating and restructuring data. This excerpt from R in Action goes over one of the most
important subjects in using R: reshaping your data so it's in the format needed for analysis and
then grouping and summarizing that data by factors. In addition to touching on base-R functions like
the useful-but-not-always-well-known aggregate(), it also covers melt() and cast() with the reshape
package. By Robert I. Kabacoff.
Getting
started with charts in R. From the popular FlowingData visualization website run by Nathan
Yau, this tutorial offers examples of basic plotting in R. Includes downloadable source code. (While
many FlowingData tutorials now require a paid membership to the site, as of May 2013 this one did
not.)
Using R for your basic statistical Needs LISA Short Course. Aimed at those who already know
stats but want to learn R, this is a file of R code with comments, making it easy to run
(and alter) the code yourself. The programming is easy to follow, but if you haven't brushed up on
your stats lately, be advised that comments such as
Suppose we'd like to produce a reduced set of independent variables. We could use the function
# step() to perform stepwise model selection based on AIC which is -2log(Likelihood) + kp? Where
k=2 # and p = number of model parameters (beta coefficients).
may be tough to follow. By Nels Johnson at Virginia Tech's Laboratory for Interdisciplinary Statistical
Analysis.
Producing Simple Graphs with R.
Although 6+ years old now, this gives a few more details and examples for several of the visualization
concepts touched on in our beginner's guide. By Frank McCown at Harding University.
Short courses. Materials from various
courses taught by Hadley Wickham, chief scientist at RStudio and author of several popular R packages
including ggplot2. Features slides and code for topics beyond beginning R, such as R development
master class.
Quick
introduction to ggplot2. Very nice, readable and -- as promised -- quick introduction to
the ggplot2 add-on graphic package in R, incuding lots of sample plots and code. By Google engineer
Edwin Chen.
ggplot2 workshop presentation.
This robust, single-but-very-long-page tutorial offers a detailed yet readable introduction to the
ggplot2 graphing package. What sets this apart is its attention to its theoretical underpinnings
while also offering useful, concrete examples. From a presentation at the Advances in Visual Methods
for Linguistics conference. By Josef Fruehwald, then a PhD candidate at the University of Pennsylvania.
ggplot2_tutorial.R.
This online page at RPubs.com, prepared for the Santa
Barbara R User Group, includes a lot of commented R code and graph examples for creating data visualizations
with ggplot2.
More
and Fancier Graphics. This one-page primer features loads of examples, including explainers
of a couple of functions that let you interact with R plots, locator() and identify() as well as
a lot of core-R plotting customization. By William B. King, Coastal Carolina University.
ggplot2 Guide.
This ggplot2 explainer skips the simpler qplot option and goes straight to the more powerful but
complicated ggplot command, starting with basics of a simple plot and going through geoms (type of
plot), faceting (plotting by subsets), statistics and more. By data analyst George Bull at Sharp
Statistics.
Using R. In addition
to covering basics, there are useful sections on data manipulation -- an important topic not easily
covered for beginners -- as well as getting statistical summaries and generating basic graphics with
base R, the Lattice package and ggplot2. Short explainers are interspersed with demo code, making
this useful as both a tutorial and reference site. By analytics consultant Alastair Sanderson,
formerly research fellow in the Astrophysics & Space Research (ASR) Group at the University of Birmingham
in the U.K.
The Undergraduate Guide to R. This is a highly readable, painless introduction to R that
starts with installation and the command environment and goes through data types, input and output,
writing your own functions and programming tips. Viewable as a Google Doc or downloadable as a PDF,
plus accompanying files. By Trevor Martin, then at Princeton University, funded in part by an
NIH grant.
How to turn
CSV data into interactive visualizations with R and rCharts. 9-page slideshow gives step-by-step
instructions on various options for generating interactive graphics. The charts and graphs use jQuery
libraries as the underlying technology but only a couple of line of R code are needed. By Sharon
Machlis, Computerworld.
Higher Order Functions in R. If you're at the point where you want to apply functions on
multiple vectors and data frames, you may start bumping up against the limits of R's apply family.
This post goes over 6 extremely useful base R functions with readable explanations and helpful examples.
By John Mules White, "soon-to-be scientist at Facebook."
Introductory Econometrics
Using Quandl and R While this does indeed promote Quandl as your data source, that data
is free, and for those interested in using R for regressions, you'll find several detailed
walk-throughs from data import through statistical analysis.
Introduction to dplyr. The dplyr package (by ggplot2 creator Hadley Wickham) significantly
speeds up operations like grouping and sorting of data frames. It also aims to rationalize such functions
by using a common syntax. In this short introductory vignette, you'll learn about "five basic data
manipulation" -- filter(), arrange(), select(), mutate() and summarise() -- including examples, as
well as how to chain them together for more streamlined, readable code. Another useful package for
manipulating data in R:
doBy.
Applied
Time Series Analysis. Text-based online class from Penn State "to learn and apply statistical
methods for the analysis of data that have been observed over time." Access to the articles is free,
although there is no community or instructor participation.
13 resources for time series
analysis. A video and 12 slide presentations by Rob J. Hyndman, author of Forecasting time
series using R. Also has links to exercises and answers to the exercises.
knitr in a knutshell.
knitR is designed to easily create reports and other documents that can combine text, R code and
the results of R code -- in short, a way to share your R analyses with others. This "minimal tutorial"
by Karl Broman goes over subjects such as creating Markdown documents and adding graphics and tables,
along with links to resources for more info.
More free downloads and websites from academia:
Introducing
R. Slide presentation from the UCLA Institute for Digital Research and Education, with
downloadable data and code.
Introducing R.
Although titled for beginners and including sections on getting started and reading data, this
also shows how to use R for various types of linear models. By German Rodriguez at Princeton University's
Office of Population Research.
R: A self-learn tutorial. Intro PDF from National Center for Ecological Analysis and Synthesis
at UC Santa Barbara. While a bit dry, it goes over a lot of fundamentals and includes exercises.
Statistics
with R Computing and Graphics. Unlike many PDF downloads from academia, this one is both
short (15 pages) and basic, with some suggested informal exercises as well as explanations on
things like getting data into R and statistical modeling (understanding statistical concepts like
linear modeling is assumed). By Kjell Konis, then at the University of Oxford.
Little
Book of R for Time Series. This is extremely useful if you want to use R for analyzing data
collected over time, and also has some introductory sections for general R use even if you're not
doing time series. By Avril Coghlan at the Wellcome Trust Sanger Instituie, Cambridge, U.K.
Statistics
and R on Google+. Community members are knowledgeable and helpful, and various conversation
threads engage both newbies and experts.
Twitter #rstats hashtag.
Level of discourse here ranges from beginner to extremely advanced, with a lot of useful R resources
and commentary getting posted.
Stackoverflow
has a very active R community where people ask and answer coding questions. If you've got a specific
coding challenge, it's definitely worth searching here to see if someone else has already asked about
something similar.
R-bloggers. This site
aggregates posts and tutorials from more than 250 R blogs. While both skill level and quality can
vary, this is a great place to find interesting posts about R -- especially if you look at the "top
articles of the week" box on the home page.
Revolutions. There's plenty
here of interest to all levels of R users. Although author Revolution Analytics is in the business
of selling enterprise-class R platforms, the blog is not focused exclusively on their products.
Post: 10 R packages I wish I knew about earlier. Not sure all of these would be in my
top 10, but unless you've spent a fair amount of time exploring packages, you'll likely find
at least a couple of interesting and useful R add-ons.
Translating between
R and SQL. If you're more experienced (and comfortable) with SQL than R, it can be frustrating
and confusing at times to figure out how to do basic data tasks such as subsetting your data. Statistics
consultant Patrick Burns shows how to do common data slicing in both SQL and R, making it easier
for experienced database users to add R to their toolkit.
Graphs
& Charts in base R, ggplot2 and rCharts. There are lots of sample charts with code here,
showing how to do similar visualization tasks with basic R, the ggplot2 add-on package and rCharts
for interactive HTML visualizations.
When to use Excel, when to use R? For spreadsheet users starting to learn R, this is a useful
question to consider. Michael Milton, author of Head First Data Analysis (which discusses
both Excel and R), offers practical (and short) advice on when to use each.
Using dates and times in R. This post from a presentation by Bonnie Dixon at the Davis R Users'
group goes over some of the intricacies of dates and times in R, including various date/time classes
as well as different options for performing date/time calculations and other manipulations.
Scraping Pro-Football Data and Interactive Charts using rCharts, ggplot2, and shiny. This is
a highly useful example of beginning-to-end data analysis with R. You'll see a sample of how to scrape
data off a website, clean and restructure the data and then visualize it in several ways, including
interactive Web graphics -- all with downloadable code. By Vivek Patil, an associate professor at
Gonzaga University.
Search
Searching for "R" on a general search engine like Google can be somewhat frustrating, given how
many utterly unrelated English words include the letter r. Some search possibilities:
RSeek is a Web search engine that just returns
results from certain R-focused websites.
R site search returns results
just from R functions, package "vignettes" (documentation that helps explain how a function works)
and task views (focusing on a particular field such as social science or econometrics).
Google's
R Style Guide. Want to write neat code with a consistent style? You'll probably want a style
guide; and Google has helpfully posted their internal R style for all to use. If that one doesn't
work for you, Hadley Wickham has a fairly abbreviated
R style guide based on Google's but
"with a few tweaks."
RStudio documentation. If you're
using RStudio, it's worth taking a look at parts of the documentation at some point so you can take
advantage of all it has to offer.
History
of R Financial Time Series Plotting. Although, as the name implies, this focuses on financial
time-series graphics, it's also a useful look at various options for plotting any data over time.
With lots of code samples along with graphics. By Timely Portfolio on GitHub.
Grouping
& Summarizing Data in R. There are so many ways to do these tasks in R that it can be
a little overwhelming even for those beyond the beginner stage to decide which to use when. This
downloadable Slideshare presentation by analyst Jeffrey Breen from the Greater Boston useR Group
is a useful overview.
Apps
R Instructor. This app is primarily
a well-designed, very thorough index to R, offering snippets on how to import, summarize and plot
data, as well as an introductory section. An "I want to..." section gives short how-to's on a variety
of tasks such as changing data classes or column/row names, ordering or subsetting data and more.
Similar information is available free online; the value-add is if you want the info organized in
an attractive mobile app. Extras include instructional videos and a "statistical tests" section explaining
when to use various tests as well as R code for each. For
iOS and
Android, about $5.
Comprehensive R Archive Network (CRAN).
The most important of all: home of the R Project for Statistical Computing, including downloading
the basic R platform, FAQs and tutorials as well as
thousands of add-on packages.
Also features detailed documentation and a number of links to more resources.
RStudio. You can download
the free RStudio IDE as well as RStudio's
Shiny project aimed at turning R analyses
into interactive Web applications.
Shiny for interactive Web apps. This
open-source project from RStudio is aimed at creating interactive Web applications from R analysis
and graphics. There's a Shiny
tutorial at the RStudio site; to see more examples,
Show Me Shiny offers a gallery of apps
with links to code.
Swirl. This R package for interactive learning
teaches basic statistics and R together. See
more info on version 2.0.
Sharon Machlis
— Executive Editor, Online & Data Analytics
Sharon Machlis is Executive Editor, Online & Data Analytics at Computerworld, where
she works on data journalism projects and in-house editor tools in addition to writing and editing.
"...The book is best for people who have a rudimentary knowledge of R and want to learn about the
many methods for analyzing data in R. The excellent breadth of coverage means that there is not a great
deal of depth for any particular topic."
Better name would be "Intro to data analysis using R"
1. The content of this book is similar to an earlier book by the same author (Statistical
Computing: An Introduction to Data Analysis using S-Plus), but now capitalizing on the popularity
of R The earlier book had a much more appropriate name, as the focus of the book is on data
analysis (with R), not on R itself. People reading this book hoping to learn R will be disappointed.
The book is best for people who have a rudimentary knowledge of R and want to learn about the
many methods for analyzing data in R. The excellent breadth of coverage means that there is not
a great deal of depth for any particular topic.
2. The R code makes extensive use of the "attach" function to attach data frames. This is
nearly a cardinal sin, for it leads to a cluttered work environment. This is a carryover
from the very ancient way of doing things in S-Plus. It's really not that hard to add "data= "
arguments to the function calls, or use the "with" function.
3. Some people have had trouble finding the datasets used in the book. The general trend these
days is that book authors often create an R package containing the data used in the book.
I suggest this be done for any future edition of the book.
Bydrmrgdon September 21, 2013
Save you money...don't buy this one
This is by and large the worst book I've ever purchased for learning a new language and / or programming
utility. I sorely regret buying this book, and wish I had searched a bit more thoroughly for a
book that is better suited to helping me learn how to work with my data in R.
From the start, the author very quickly skims over many key topics without really going into detail
on how to use them. Worse yet, he introduces functions and topics in command examples and formulas
without explaining how they work until later in the chapter / book (and without a reference to
the function). For example he uses 'tapply' on page 21 before explaining what it does (that doesn't
happen until page 42), and there were several others that had me scratching my head. I could use
the help function in R to see what the function does, but the help in R is completely cryptic
to me and not terribly useful. The point of buying this book was to (hopefully) get a better idea
of how these functions work and how to use them.
Understandably so, the author often imports datasets in order to show how to perform specific
tasks. However, there is no obvious indication on where one can find these data, and there's no
way to learn the material without actively following along. I did end up finding the datasets
online after Google searching for them (the author apparently has a website with most
(but not all!) of these data), and later on I ended up finding a note in the Acknowledgements
section stating where the data is. Why is this not indicated in the "Getting Started" chapter
in the "How to use this book" section? Further, not all of the data is located on his website,
and I've come across several examples of missing datasets. As an example, I skipped ahead to the
Classic Tests chapter to see what was going on there, and the first dataset referenced is called
'classic.txt', which is nowhere to be found. Guess I'll skip over that section without dissecting
how the author is performing his analysis! One other piece of advice for anyone looking for
these data: download all of the individual files rather than the .zip file linked. The zip file
does not contain all of the individual files!
All of the author's material is strictly Windows based. There are no indications of comparable
commands for Linux (and I'll assume this also holds true for Mac users). For example, the author
occasionally uses the 'windows' command to scale a plot window. However, that is not a valid command
in the Linux installation of R, and after searching for a while, I was able to find the equivalent
command so that I can follow along again (it's 'X11()' by the way). Most of the other programming
books I have read take into consideration that a user will be working on one of the big three
operating systems and help guide you with the appropriate commands when it's relevant.
Overall it seems the author is more concerned with teaching statistics than how to use R and
how to import, manipulate, and manage the data in R. I was hoping to learn more about actually
using the language and learning how to work with my own datasets. But in the end (well not quite
the end yet, I've only gotten to chapter 6 so far), I really don't have much of a better understanding
than before I started of how factors, level, and vectors work, how to transform my data from a
table (like generated from Excel or a Perl script) to R in order to work with it, and how to graphically
represent these data the way I want. Amongst the missing data, the typos and bad commands, the
only surface skimmed details of functions and commands, and mono-OS minded operations in the book,
I'm still quite lost and don't expect to get a whole lot out of this book for the price. My money
would definitely have been better spent elsewhere.
You will be disappointed if you are a competent R programmer looking for "hacks". Note that
the only negative review so far mentions its author's four-year experience with R. Mine is much
shorter, yet I too find the book too "junior" for my needs. (With "R in Nutshell" and Google at
my disposal, I can send "R Cookbook" back after making several notes to record what I learnt from
it. There are several nuggets that you will not find in "R in Nutshell", or will not think to
google). However, the book is not advertised as an "R in Depth", so no complaints.
"R Cookbook" is a friendly and highly informative introduction to "general-purpose" R (one half
of the book) and doing basic statistics with R (the other half). A chapter on time series, with
a look at "zoo" package, is a bonus; a somewhat light (but does-the-job) take on R graphics may
be viewed as a downside, but I see the benefit of getting the basics right, and letting the reader
explore other resources - I would recommend "R Graphs Cookbook" and Quick-R Web site - when he/she
is ready.
Yes, there are free R tutorials out on the Web - but given that this one is widely praised and
inexpensive (even if you are never going to resell it - and at some point you probably should,
and move to "R in Nutshell" - $25 is not too much. How much saved time is worth $25 for you?),
why not take a look?
PS. "R in Action" by Robert Kabacoff is another option, and one that I actually like better.
PPS. The second edition of Michael Crawley's "R Book" is a large improvement over the first, and
is a stronger competitor to both "R Cookbook" and "R in Action".
Paulo C. Rios Jr. on May 14, 2015
A simple and masterful book with many insights - better than many textbooks on R
With clear and concise explanations covering most of the important areas, this is a brilliant
book. It can not only save you plenty of time, but also help you to gain new insights as you learn
from comprehensive but short and clear discussions of so many different topics. They are all explained
in a such a way that you can directly access anyone of them without having to read the rest of
the book. Some highlights:
- The chapter 2 on "Some Basics" is simple but mandatory for any beginner.
- Chapter 5 on "Data Structures" is one of the best along with Chapter 12 on "Useful Tricks".
Chapter 5 covers data structures in a clearer and better way than many other books on R.
- Chapter 6 on "Data Transformations" shows the beauty and power of R in short but very
good examples.
- Statistics with R is covered in Chapter 8 on "Probability" and chapter 9 on "General
Statistics", whereas Chapter 11 covers "Linear Regression and ANOVA". Here again the very clear
prose and simple examples show these applications of R in a much better way than books on R
and "advanced analytics" like "R for Everyone" (a book that is a big disappointment).
- There is a good coverage of graphics in Chapter 10, whereas the author still found space
to treat time series analysis in Chapter 14 with more brilliant examples.
What is missing? A coverage of RStudio, a great and free development environment for R. There
is also a lack of any examples covering statistical learning data analysis other than linear regression
which actually belongs more to standard statistical analysis.
But this is little in comparison to what it offers. This is a great book written in a masterful
way not only in knowing the subject matter but also in knowing how to present it and teach it.
Best R book I ever read
By Junyu Lee on May 30, 2012
Format: Paperback
The reason I picked this book because I read a article in a Chinese R BBS which recomanded this
book as the best book for beginner. I checked Amazon reviews, it only had 3.4. Someone even gave
it one star. I was glad I didn't take these reviews serously. Just as the saying: one man's food
is another man's poison. I found this book was right for me.
First, there is no book which can cover everything of R, even the very common used part. If there
is one, it might be the most boring book in the world. Second, the part you use day in day out, might
not be the part others use frequently. Third, a lot of stuff, you have to learn when you have a problem
to solve. The simple example is, when I started to learn read.table, I have no idea what all these
arguments were and how to use them. Later, I had problem, I gradually learned how to use skip, nrows,
row.names. There are still a lot, such as check.names, I have never used so far and don't know and
don't care. I don't think a book should list all these stuff. That would be super boring.
I had taught myself R using The R Book before I read this one. I found the best of book, it taught
you something you could put to use right away. I especially like its statistic part, simple, clear,
and staight forward. It covers a lot of stuff usually not covered by most of books. For example,
it explains the output of the summary (lm(x~y)) which I wanted to know but felt too embarrassed to
ask because I thought everybody knew except me.
This book is right for beginner like me. As I said, if you want to learn how to build a car, how
the engine works before you learn how to drive a car, this book is not for you. If you simple want
to learn just how to drive plus a little bit maintenance, totally don't care how engine works, this
is the right book for you. By the way, The R Book is a really good book for the R part. The statistic
part is too complicate for me. Two much engine manufacture stuff.
The low rating reflects my opinion of the book vis-à-vis the alternatives, not its merits when
viewed on its own. My original review was actually robust four stars;
I did point to a book which, in my opinion, was a better proposition than "Learning R" - "R in
Action" by Robert Kabacoff - but acknowledged a few areas where "Learning R" had the edge.
Then "R for Everyone" by Jared Lander came out and, what can I say, I see "R in Action" and "R
for Everyone" as the two plausible beginner-to-intermediate-R-book choices, and "Learning R" a very
distant third.
The lack of statistical content was a deliberate design decision. Part of the reason that I wrote
the book was that existing books introducing R were almost all focused on how to do statistics in
R; they emphasized modelling at the expense of explaining data manipulation and programming. If you
want to learn statistics at the same time as learning R, then I recommend The R Book by Michael Crawley.
http://www.amazon.co.uk/The-Book-Michael-J-Crawley/dp/0470973927/
Data visualization and graphics are also really well covered by other books. Paul Murrell's R Graphics
is the definitive reference. http://www.amazon.co.uk/Graphics-Second-Edition-Chapman-Series/dp/1439831769
As for the arcana, there was a continual struggle between streamlining the book, and warning about
R's quirks. Some people like knowing about weird design decisions, others just want bread-and-butter,
so it's hard to please everyone.
In the end, it was a personal decision: I like quirks, so they
stayed in.
With a background as a developer, I found this book very approachable having not touched R before
this book. It remained close to the R language itself and did not veer too deep into statistics.
For a programmer new to the language and the topic, I was fine with the subject matter depth.
I really liked that the end of each chapter included a quiz as well as exercise portions. The answers
are included as part of the Appendix and I think are a good reminder to readers to try out what they
just learned. Part of learning new languages is finding about different concepts or how data structures
are implemented with different names, functions, or packages. Newer topics to me were data frames
and factors. These concepts are explained very well and allowed for me to quickly apply existing
knowledge from other languages to make the concepts clear. In my opinion, I really liked the chapters
involving getting data and on cleaning and transforming. These chapters are very practical and apply
to anyone who has had to parse data in one format to put it into another. Topics like loading packages
and data and time coverage are sections that you would expect to be in a book for beginners new to
the language and hint at the audience this book is geared toward. It is a good starting point for
those totally new to the language who will use this as a foundation to dig deeper for specific tasks
later.
Overall conclusion: Good for the programmer interested in learning the R language over in-depth statistics.
Disclaimer: I got a copy of this book for review as part of O'Reilly blogger program.
The choice of a casino for nearly all the examples in the book is very
annoying. There are so many better business cases and exciting public data available. What a poor
choice. This isn't really hands-on. Almost nothing of the exciting applications of R in data
science is actually shown. The examples are too simple and constrained. There is a lack of insight.
And some kind of misdirected teaching.
The very long data frame in page 57, occupying half a page, with the entire deck of cards to display
a bad idea is a sad example. The creation of a data frame with zero columns and rows in page 69 is
another, but unfortunately not the only ones.
The use of R Studio is a great choice, but it is a very small positive point in front of the many
shortcomings of this book.
The book is short, but very limited, with very bad examples and very pricey. Not recommended.
There is a shortage of good R books in the market, but "R in Action" (second edition is coming),
"The Art of R Programming" and "The R Book" are much superior choices.
In my mind, R programming is mostly about data manipulation and visualization. In this book,
R programming is about procedural programming in R, with a quick glance at the language's OOP
features. This places "Hands-On R Programming" between most R learning aids, which cover [most
of] these things within a chapter - my recommendation in this field is Robert Kabacoff's "R in
Action" - and Norman Matloff's "The Art of R Programming", which covers a lot more ground and
has a lot more depth, while being just as accessible, and actually cheaper. I have no complaints
about the author's execution of his plan for the book - put simply and positively, I like his
writing - but am pessimistic about the plan itself, and do not see the book as a worthwhile investment
of $30+.
Another great resource for learning R. While it is frustrating that all these books cover the
same basic information they all cover it slightly differently. This book coming from the RStudio's
chief trainer is a well designed book which covers many aspects not covered as well as other books.
R as a programing language has also evolved so much over the past 5 years that I find that the
newer books are a better start for beginners, not that the classics should be skipped. This book
has a cleaner narrower focus and is a great fit for someone new to R. It uses less libraries and
the libraries it uses are clean and make working with R easier. Also I couldn't imagine working
with R without using RStudio and this book also shows short cuts on the language's best IDE that
is free for personal use.
My suggestion is that someone with little to no experience programing should maybe get two books
to learn R.
1) R for Everyone by Jared P. Lander (Though the font for the code in Kindle is frustrating
because it doesn't show symbols correctly unless you copy and paste the code!)
2) Hands-On Programming with R by Garrett Gromlemund.
Than after under standing these books and maybe doing a few free online courses get
1) The Art of R Programming by Norman Matloff and
2) R in Action by Robert Kabacoff (Only available for sale at the publishers website for the
EBook)
What I want is a second book on using Hadley Wickham's libraries as a second book. Using Reshape2,
ddplyr, tidyr, stringr, tidyr, ggplot2, ggvis and shiny.
The Last but not LeastTechnology is dominated by
two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt.
Ph.D
FAIR USE NOTICEThis site contains
copyrighted material the use of which has not always been specifically
authorized by the copyright owner. We are making such material available
to advance understanding of computer science, IT technology, economic, scientific, and social
issues. We believe this constitutes a 'fair use' of any such
copyrighted material as provided by section 107 of the US Copyright Law according to which
such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free)
site written by people for whom English is not a native language. Grammar and spelling errors should
be expected. The site contain some broken links as it develops like a living tree...
You can use PayPal to to buy a cup of coffee for authors
of this site
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or
referenced source) and are
not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society.We do not warrant the correctness
of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be
tracked by Google please disable Javascript for this site. This site is perfectly usable without
Javascript.