library(funspotr)
file_lines <- "
library(dplyr)
require(tidyr)
library(madeUpPkg)
as_tibble(mpg) %>%
group_by(class) %>%
nest() %>%
mutate(stats = purrr::map(data,
~lm(cty ~ hwy, data = .x)))
made_up_fun()
"
file_output <- tempfile(fileext = ".R")
writeLines(file_lines, file_output)
spot_pkgs(file_output)
# To view `purrr::map` as an explicit call
spot_pkgs(file_output, show_explicit_funs = TRUE)
# To output for blogdown post YAML header tags
cat(spot_pkgs(file_output, as_yaml_tags = TRUE))
Run the code above in your browser using DataLab