Chapter 2 R basics
More specifically, this chapter covers essential concepts and commands of base R, which essentially is R without any additional packages.
Important concepts and contents include:
- R objects as data vs. functions;
- creating and changing R objects (by assignment);
- different types of data (e.g., Boolean values of type logical, numbers of type integer or double, and text of type character);
- exploring functions and their arguments.
An important constraint of this chapter is that we will deal with vectors as our only data structure. This allows introducing key concepts of R like subsetting (aka. indexing or filtering) and recycling. In the next Chapter 3 on Data structures, we will encounter additional data structures (e.g., matrices, lists, and tables).
Recommended readings for this chapter include:
Before reading, please take some time to reflect upon the following questions:
What is being manipulated by computer code?
What are some differences between a variable and a function?
Which types of data can we distinguish?
In which order is computer code evaluated?
Which windows in the RStudio IDE allow interacting with R?