6.9 Packages & their dependencies

R packages frequently use other R packages (which frequently use other R packages…). When an R package requires another package, its called a dependency. Depending on who and how the package was written up, dependencies might not be an issue or could be a problem.

As noted above when you download packages using RStudio’s point and click interface there’s a box that should be checked called “Install dependencies.”

If you are using install.packages() there is an extra argument “dependencies = TRUE” that elicits the same behavior. I’ll use this to get an add-on for ggplot2 called ggpubr.

install.packages("ggpubr",dependencies = TRUE)

We can then install this

library(ggpubr)