Mastering R (or any other programming language) essentially consists in solving three inter-related tasks:
- Using data types for representing information as objects (Section 2.2.1),
- Using functions (Section 2.2.3) for manipulating those objects, and
- Creating and manipulating larger data structures for representing information (Section 2.3).
Given some objects of various data types, some functions for exploring and manipulating them, and some data structures for storing all this information is really all we need for doing pretty amazing stuff — all the rest are details…
This chapter introduces basic concepts and essential R commands. It does not deal with specific R packages, graphics, or any details, but lays the foundation for caring about all those.
2.1.2 Data and tools
This chapter only uses base R functions and some example data that we will generate along the way.