libr_called | R Documentation |
Retrieves a vector of all package names which are called within an 'R' script.
libr_called(script = NULL)
script |
Character vector. 'R' script to be processed. If NULL, an active 'R' script is used. |
Retrieves a vector of package names.
script_content <- 'library(rstudioapi)
ActiveDocument <- getActiveDocumentContext()$path
min_c <- min(c(1,2,3))
require(dplyr)
pacman::p_load(tidymodels)'
temp_script_path <- tempfile(fileext = ".R")
writeLines(script_content, con = temp_script_path)
libr_called(script = temp_script_path)
unlink(temp_script_path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.