path <- tempfile(fileext = ".R")
writeLines(
c(
"# one messy analysis file",
"library(stats)",
"requireNamespace(\"utils\")",
"filter(1:10, rep(1, 3))",
"utils::head(letters)"
),
path
)
universe <- build_universe_data(c("stats", "utils"))
scan_usage(path, universe, ignore_unqualified_functions = character())
unlink(path)
Run the code above in your browser using DataLab