Match package names
match_pkg_names(string_og)
Text string (script) with package load calls.
A tibble with the package load calls and package names.
test_string <- c("library(boot)\nrequire(Matrix)")
match_pkg_names(test_string)
#> # A tibble: 2 × 3
#> call package_name pkgname_clean
#> <chr> <chr> <chr>
#> 1 library(boot) boot boot
#> 2 require(Matrix) Matrix Matrix