Skip to content

Commit 4690461

Browse files
committed
refactor: replace lapply with for loop in get_libraries.
- Replace lapply with a for loop to load packages individually while suppressing startup messages.
1 parent bb1d23a commit 4690461

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

R/get_libraries.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ require_package <- function(pkgs, loading = TRUE) {
1818
}
1919
rlang::check_installed(pkgs)
2020
if (loading) {
21-
suppressPackageStartupMessages(lapply(pkgs,
22-
library,
23-
character.only = TRUE,
24-
quietly = TRUE
25-
)
26-
)
21+
for (pkg in pkgs) {
22+
suppressPackageStartupMessages(library(pkg,
23+
character.only = TRUE,
24+
quietly = TRUE
25+
)
26+
)
27+
}
2728
}
2829
}
2930

0 commit comments

Comments
 (0)