att_from_examples: Get all packages called in examples from R files

View source: R/add_from_examples.R

att_from_examplesR Documentation

Get all packages called in examples from R files

Description

Get all packages called in examples from R files

Usage

att_from_examples(dir.r = "R", encoding = getOption("encoding"))

Arguments

dir.r

path to directory with R scripts.

encoding

Encoding passed to readLines() when reading source files. Defaults to getOption("encoding") so the system locale is respected, matching att_from_rscript().

Value

Character vector of packages called with library or require.

Examples

dummypackage <- system.file("dummypackage",package = "attachment")

# browseURL(dummypackage)
att_from_examples(dir.r = file.path(dummypackage,"R"))

attachment documentation built on Oct. 1, 2026, 1:08 a.m.