A base R function comes with the standard R installation and works without an additional package. These out-of-the-box functions provide the starting point for scripts, including installing and loading packages before analysis begins. section 1.3 section 2.1
Use base R functions to prepare the package environment:
- Install a package once with install.packages("tidyverse"). section 2.1
- Load installed packages whenever their functions are needed with library(tidyverse). section 2.1
- Continue with packaged functions for data wrangling and visualization after the setup step. section 1.3 section 2.1
Setting up a script
A script can install the tidyverse with install.packages("tidyverse"), then load it with library(tidyverse). Installation happens once; loading happens wherever the package is used. section 2.1
Figure 1.5 A typical chapter flow and, not coincidentally, the typical end-to-end flow of most real-world data science and statistics projects
Follow the end-to-end project flow from setup and package loading through analysis and presentation. section 1.3
