2.4 Conclusion

2.4.1 Summary

This chapter provided a very brief introduction to R (R Core Team, 2021b). Conceptually, we essentially introduced and distinguished between

  • different R objects (e.g., data vs. functions),
  • different types of data (e.g., Boolean values of type logical, numeric objects of type double or integer, and text objects of type character), and
  • different shapes of data (e.g., scalars, vectors, and various types of tables).

We then showed how to create and change objects in R (by assignment), how to create vectors and tables (by using the c() and data.frame() functions), and how to access and change elements of vectors and tables (by indexing/subsetting). And in the process of creating and checking R objects, we used a variety of functions to check, compare, or manipulate data objects.

2.4.2 Resources

i2ds: Links to resources, etc.

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.

Books and online scripts

- For advanced users, Hadley Wickham's books [Advanced R](http://adv-r.had.co.nz/) [@Wickham2014advanced; @Wickham2019advanced] and [R Packages](http://r-pkgs.had.co.nz/) [@Wickham2015] are indispensable resources  


Here are some pointers to related RStudio cheatsheets:

  • Base R:
Base R summary from RStudio cheatsheets.

Figure 2.1: Base R summary from RStudio cheatsheets.

  • Advanced R:

Figure 2.2: (ref:fig-basics-cheat-adv-R1)


Other helpful links that do not fit into the above categories include:

  • 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.

2.4.3 Preview

The next chapter re-shapes vectors into matrices and combines vectors into more complex data structures (e.g., data frames, lists).


Grolemund, G. (2014). Hands-on programming with R: Write your own functions and simulations. O’Reilly Media. https://rstudio-education.github.io/hopr/
Phillips, N. D. (2018). YaRrr! The pirate’s guide to R. https://bookdown.org/ndphillips/YaRrr/
R Core Team. (2021b). R base: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org
Wickham, H. (2019a). Advanced R (2nd ed.). Chapman; Hall/CRC. https://adv-r.hadley.nz/