autodep: Automate package dependency writing

View source: R/autodep.R

autodepR Documentation

Automate package dependency writing

Description

Automatically register namespace::function calls

Usage

autodep(
  path = ".",
  overwrite = FALSE,
  register_symbols = FALSE,
  roxygen_file_name = "R/package_imports.R",
  ignore_base_package = TRUE
)

Arguments

path

The path to the package - defaults to ".".

overwrite

Whether to overwrite existing dependencies - defaults to **FALSE**.

register_symbols

Whether to try to register symbols such as the **magrittr ' or the **data.table ':='**. Highly experimental, and by default **FALSE**.

roxygen_file_name

The **.R** file to render the roxygen into - by default **"R/package_imports.R"**. Note that the specification of the **/R** project subdirectory is necessary.

ignore_base_package

Whether to ignore the base package imports (this is an option only for the corner cases where someone **might** want to import the base environment, which we anticipate will never happen). Defaults to **TRUE**.

Details

This function automatically writes package dependencies and generates roxygen tags to import necessary dependencies for a package, specified via the namespace::function convention. Write your code like you always would, and let this handle the boring work. The dependencies are written to the description file into the **Imports** section - where warranted, you can easily change this manually, but it seems as a reasonable default.


JSzitas/autodep documentation built on April 4, 2022, 1:48 a.m.