Copies the built-in zzz_template.R to the target package's R/ directory
and replaces template placeholders (all-caps words) with values from the
package DESCRIPTION file.
Template placeholders replaced:
PKG— package namePKG-package—{pkgname}-packageTITLE— package titleDESCRIPTION— package description (multiline values get#'prefix)LICENSE— license type
Other information:
.onLoadand.onAttachis added to the file.usethisnamespace is added to the file.
Usage
use_zzz(
path = NULL,
file_name = paste0(get_package_name(path = path), "-package.R"),
overwrite = FALSE,
open = rlang::is_interactive(),
...
)Arguments
- path
Character. Path to the package root directory. If
NULL(the default), uses the current working directory.- file_name
Character. Output file name. Defaults to
"<pkg_name>-package.R".- overwrite
Logical. If
TRUE, overwrite an existing file. Defaults toFALSE.- open
Logical. Whether to open the created file in the default editor.
- ...
Not used.
Examples
if (FALSE) { # \dontrun{
dir <- tempdir()
usethis::create_package(dir)
use_zzz(dir)
} # }
