1.9 Resources
We conclude this introductory chapter on Basic R concepts and commands with some pointers to related resources.
1.9.1 Help on R
Most brains have better things to do than remembering all R commands and arguments. Instead, more experienced users of R are typically very good at looking up relevant information. To do this effectively and efficiently, knowing how and where to look is important.
The official references of the R language are pre-installed on every R system and were listed on our introductory page of Resources. Precisely how and where to look for an answer typically depends on the type of question that is being asked:
To see the documentation of a particular R function named
abc
, evaluate?abc
(in the Console or Editor panels of RStudio) to show R’s in-built help on the command with this name. For instance, evaluating?sum
provides a precise definition and some examples of the functionsum
(introduced above). Although some parts of the documentation may be difficult or confusing at first, it is typically helpful to examine the arguments, run the provided examples, and try to understand what they do and show.A more focused and typically extensive source of help are the vignettes that come with particular packages (and are accessible via the Help or Packages panels of RStudio). A vignette typically explains the backgrounds and reasons for one or more functions and shows how it can be used to solve some task.
The Posit cheatsheets provide quick visual summaries of key concepts and commands for many R-related topics and packages. For a handy language reference, check out the cheatsheets on Base R (by Mhairi McNeill) and Advanced R (by Arianne Colton and Sean Chen):
1.9.2 Learning R
There is no shortage of introductory books and scripts on R, but it is helpful to look for one that fits your interests and level of expertise.
To learn R by reading only one book, my recommendation would be Norman Matloff’s The art of R programming (Matloff, 2011). It provides a sound introduction to R, but does not cover the tidyverse packages.
For programmers coming from other languages, a clear and concise tutorial on R is provided by the R notes (by Karolis Koncevicius, 2023).
Bookdown.org and its archive page contain books on a wide array of topics (and of an even wider range of quality). Easy recommendations include:
Hands-On Programming with R (Grolemund, 2014) provides a solid introduction to R. As this book proceeds much more slowly than ours, I recommend reading its introductory chapters if you found this chapter confusing.
YaRrr! The Pirate’s Guide to R (Phillips, 2018) approaches R in a fun and entertaining fashion, but only covers the basics. (See Rpository.com/learnR/ for a course with corresponding exercises and solutions.)
For advanced users of R, Hadley Wickham’s books Advanced R (Wickham, 2014a) and R Packages (Wickham, 2015) are indispensable resources. The 2nd edition of Advanced R (Wickham, 2019) discusses many topics of the current chapter in a deeper and more principled fashion:
- 2: Names and values clarifies R’s way of handling assignments and object references
- 3: Vectors explains data types and shapes (including data frames and tibbles)
- 4: Subsetting shows many ways of accessing and changing data stored in R objects
- 2: Names and values clarifies R’s way of handling assignments and object references
1.9.3 Miscellaneous
Online searches for R-related information can uncover an abundance of dubious code and outright junk, but also lots of true gems. Some helpful links that do not fit into the above categories include:
Stackoverflow is a community-based source of many R-related questions and answers.
R-bloggers collects blog posts on R.
Quick-R (by Robert Kabacoff) is a popular website on R programming.
R-exercises provides categorized sets of exercises to help people developing their R programming skills.
A series of software reviews (by Bob Muenchen) at r4stats describes and evaluates alternative user environments for interacting with R.
[01_basics.Rmd updated on 2024-09-06 12:17:29.622636 by hn.]