R Packages

R Packages are collections of R functions, data, and compiled code that extend the functionality of base R. Popular packages include dplyr, ggplot2, and tidyverse.

Key Topics

Installing Packages

# Installing a package
install.packages("dplyr")

Note:

Use install.packages() to install packages from CRAN.

Loading Packages

# Loading a package
library(dplyr)

Note:

Use library() to load the package into your session.

Key Takeaways

  • Use install.packages() to install packages from CRAN.
  • Load installed packages using library() to use their functions.
  • Packages enhance R's capabilities for data analysis, visualization, and more.