import_objs: Statically import specific objects

View source: R/import.R

import_objsR Documentation

Statically import specific objects

Description

Statically import specific objects

Usage

import_objs(
  names,
  source = system.file("staticexports", package = "staticimports"),
  outfile = here::here("R/staticimports.R"),
  label = NULL,
  append = FALSE
)

Arguments

names

A character vector of names of objects to import.

source

A directory containing source files, or an environment to use as the source.

outfile

File to write to. Defaults to R/staticimports.R in the current project. Use stdout() to output to console.

label

A label to write to the file, to indicate where the objects were imported from.

append

If TRUE, append to the output file; otherwise overwrite.

Examples

if (interactive()) {
# Import `os_name` and `walk` into your project
import_objs(c("os_name", "walk"))
}

# Write to stdout instead of R/staticimports.R
import_objs(c("os_name", "walk"), outfile = stdout())

wch/staticimports documentation built on Jan. 13, 2024, 8:48 p.m.