Automatically generate a file containing functions and related code for R package development.
add_pkg_file(
desc_file,
pkg_name = NULL,
title = NULL,
pkg_description = NULL,
author_name = NULL,
author_email = NULL,
github_url = NULL,
output_dir = NULL,
use_figlet = TRUE,
figlet_font = "Slant",
colors = c("red", "yellow", "green", "magenta", "cyan", "yellow", "green", "white",
"magenta", "cyan"),
unicode = TRUE,
verbose = TRUE
)
Creates a file in specified output directory
The DESCRIPTION file.
Must be provided, it will be used to extract package information.
Using add_pkg_file("DESCRIPTION", output_dir = "R")
,
will be created <pkg_name>-package.R based on the DESCRIPTION file in R
dir.
If you want to use some specific information,
such as author_name
or author_email
, you can provide them manually.
Character string, the name of the package. Default is NULL, which will be read from DESCRIPTION file.
Character string, title of the package. Default is NULL, which will be read from DESCRIPTION file.
Character string, short description of the package. Default is NULL, which will be read from DESCRIPTION file.
Character string, name of the package author. Default is NULL, which will be read from DESCRIPTION file.
Character string, email of the package author. Default is NULL, which will be read from DESCRIPTION file.
Character string, GitHub URL of the package. Default is NULL, which will be read from DESCRIPTION file or constructed based on package name.
Character string, directory where to save the package file. Default is NULL, you should specify it, such as 'R'.
Logical, whether to use figlet for ASCII art generation. Default is TRUE. Details see figlet.
Character string, figlet font to use. Default is "Slant".
Character vector, colors to use for the logo elements.
Logical, whether to use Unicode symbols. Default is TRUE.
Logical, whether to print progress messages. Default is TRUE.