Create a temporary R package from a script or folder
create_temp_package.Rd
If pkg is not provided, the package name is based on the basename of the project working directory. By default, the package is created in a temporary directory and deleted when the session restarts.
Arguments
- path
A character vector of one or more paths.
- pkg
Package name. Optional.
- fields
A named list of fields to add to
DESCRIPTION
, potentially overriding default values. Seeuse_description()
for how you can set personalized defaults using package options.- rstudio
If
TRUE
, callsuse_rstudio()
to make the new package or project into an RStudio Project. IfFALSE
and a non-package project, a sentinel.here
file is placed so that the directory can be recognized as a project by the here or rprojroot packages.- check_name
Whether to check if the name is valid for CRAN and throw an error if not.
- open
If
TRUE
, activates the new project:If using RStudio desktop, the package is opened in a new session.
If on RStudio server, the current RStudio project is activated.
Otherwise, the working directory and active project is changed.
- tmp_dir
Directory where temporary package is created. Defaults to
tempdir()
.- overwrite
Default
FALSE
. IfTRUE
, overwrite the NAMESPACE file and any R scripts at the same location sharing the same names.- call
The execution environment of a currently running function, e.g.
caller_env()
. The function will be mentioned in error messages as the source of the error. See thecall
argument ofabort()
for more information.