set_package_info: Set a Package's Info

View source: R/main.R

set_package_infoR Documentation

Set a Package's Info

Description

Fill DESCRIPTION, R/xxx-package.R and an introductory vignette with the same Title, Description and possibly Details, keeping the info given in different places identical.

Usage

set_package_info(
  path,
  author_at_r = getOption("packager")[["whoami"]],
  title = "What it Does (One Line, Title Case)",
  description = NULL,
  details = NA,
  ...
)

Arguments

path

Path to the package.

author_at_r

A person object.

title

A string giving the title.

description

A string giving the description.

details

A string giving the details. Defaults to NA in which case a default details are inserted. Set to NULL to have no details at all.

...

Arguments to be passed to internal function packager:::use_intro.

Value

Invisibly a list of results of setting the xxx-package.R and the DESCRIPTION.

Examples

path <- file.path(tempdir(), "myPackage")
usethis::create_package(path = path, open = FALSE)
a  <- utils::person("Your", "Name", "some@whe.re", role = c("aut", "cre"))
set_package_info(path = path, author_at_r = a, title = "What Now?",
                 description = "This package does nothing.",
                 details = "Details do not show up in DESCRIPTION.")
package_desc <- file.path(path, "DESCRIPTION")
package_info_file <- file.path(path,
                               "R", paste0(basename(path), "-package.R"))
readLines(package_desc)
readLines(package_info_file)
unlink(path, recursive = TRUE)

packager documentation built on Aug. 16, 2023, 5:08 p.m.