To load multiple packages in R, use the following:
packages <- c("randomForest","lubridate","ggplot2", "dplyr")
lapply(packages, library, character.only = TRUE)
library() or require() load only one package at a time. Using the above code will load multiple packages.
NOTE: Ensure that the packages are installed in the R environment before you load them.