Loading multiple R packages with a single command

Viewed 4532

Multiple R packages may be loaded using the function p_load function from pacman R package with the following command:

pacman::p_load("ggplot2", "lme4")

However, I want to use the command like this

Packages <- c("ggplot2", "lme4")
pacman::p_load(Packages)

which does not work. Wonder how this can be achieved?

3 Answers
Related