While there are hundreds of excellent books and websites devoted to R, the canonical source of truth regarding the R system remains the R manuals. You can find the manuals at your local CRAN mirror and on your laptop as part of the R distribution (try Help > Manuals in RGui, or Help > R Help in RStudio to find them). Unlike books, the R manuals are updated by the R Core Team with every new release, so if you're not sure how the base R system is supposed to work this is the place to check.
Note that the manuals don't cover any of the R packages (other than the base and recommended packages), so if you want to learn about the wider R ecosystem, well, that's what all those books and websites are for. (MRAN is one place to start.)
The manuals are available in HTML, PDF, and the ePub e-book format supported by some e-book readers (though not Kindle) and also one file format the Edge browser is actually really useful for. R user Colin Fay recently converted the manuals to bookdown format, using the ePub file as the source. If you'd like to see some examples of the output of the bookdown package, I've linked to those conversions below. (Note that for versions of R other than 3.4.2, you'd be better off looking at the CRAN originals — I'm not sure if Colin has plans to make the conversions with each R release.)
As of R 3.4.2, there are six manuals:
- An Introduction to R. This is the guide to base R for programmers new to the language. It covers the basic syntax and data types, base graphics, and the built-in statistical modeling functions. (I have a special fondness for this one 🙂 ).
- R Data Import/Export. as the name suggest, this covers the systems in base R for getting data into and out of R. Among other topics, it's the primary documentation for the foreign package, which covers importing data from other statistical tools. This manual also covers a few CRAN packages for accessing databases, and includes a succinct primer on SQL queries.
- R Installation and Administration. This manual covers how to get R, how to install and configure R on Windows, Mac and Unix, and how to manage package libraries. It also includes a useful index of environment variables you can use to configure R.
- Writing R extensions. This one's mainly for the package developers, and covers the process of building, testing and documenting a package. It also provides debugging and performance guides, and how to link other languages and GUIs to R.
- R Internals. This is the place to look if you ever delve into the R source code that implements R engine.
- R Language Definition. A formal specification of R's syntax, objects, and evaluation model.
Together, these manuals represent more than 500 printed pages of documentation — and that's not counting the 3500-page reference index of the manual pages for R functions and data types. That's an impressive amount of documentation, even for a system as comprehensive as R! As a reminder, you can find the latest versions on CRAN, or see the manuals for R 3.4.2 in bookdown format at the link below.
Colin FAY: R Manuals as bookdown