liveBook · Manning

Base R

As explained in Statistics Slam Dunk

A base R function is a function provided by the standard R installation without requiring an additional package.

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
CH01_F05_Sutton

Follow the end-to-end project flow from setup and package loading through analysis and presentation. section 1.3

How Statistics Slam Dunk covers it

How deep it goes
Defines out-of-the-box functions and demonstrates package setup, without examining their internal implementation.
Examples
Shows install.packages("tidyverse") and library(tidyverse) as package-management examples.
What it assumes
Assumes R and RStudio installations and teaches package installation before package loading.
What you can do after
Operate/configure R scripts by installing packages once and loading them whenever their functions are required.
How it connects
Connects base R functions with R packages, CRAN, tidyverse, data wrangling, and visualization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.