I would like to load packages in a oner and supress suppressPackageStartupMessages
at the same time.
The answer in the first link uses lapply:
packages <- c("tidyverse", "qdap", "stringr", "stringi", "textstem", "foreach", "caret", "xgboost", "quanteda")
lapply(packages, require, character.only = T)
This returns an unsightly list to the console:
[[1]]
[1] TRUE
[[2]]
[1] TRUE
[[3]]
[1] TRUE
[[4]]
[1] TRUE
Plus, I would like to also get rid of those messages that are sent to the console on load e.g.
> library(tidyverse)
Loading tidyverse: ggplot2
Loading tidyverse: dplyr
Conflicts with tidy packages --------------------------------------------------------------------
accumulate(): purrr, foreach
filter(): dplyr, stats
lag(): dplyr, stats
when(): purrr, foreach
Is there a clever, short way to both load a vector of packages AND suppressPackageStartupMessages?