| Title: | Tools to Make Developing R Packages Easier |
|---|---|
| Description: | Collection of package development tools. |
| Authors: | Hadley Wickham [aut], Jim Hester [aut], Winston Chang [aut], Jennifer Bryan [aut, cre] (ORCID: <https://orcid.org/0000-0002-6983-2759>), Posit Software, PBC [cph, fnd] (ROR: <https://ror.org/03wc8by49>) |
| Maintainer: | Jennifer Bryan <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.5.2.9000 |
| Built: | 2026-06-05 11:32:36 UTC |
| Source: | https://github.com/r-lib/devtools |
Building converts a package source directory into a single bundled file.
If binary = FALSE this creates a tar.gz package that can
be installed on any platform, provided they have a full development
environment (although packages without source code can typically be
installed out of the box). If binary = TRUE, the package will have
a platform specific extension (e.g. .zip for windows), and will
only be installable on the current platform, but no development
environment is needed.
build( pkg = ".", path = NULL, binary = FALSE, vignettes = TRUE, manual = FALSE, args = NULL, quiet = FALSE, ... )build( pkg = ".", path = NULL, binary = FALSE, vignettes = TRUE, manual = FALSE, args = NULL, quiet = FALSE, ... )
pkg |
The package to use, can be a file path to the package or a
package object. See |
path |
Path in which to produce package. If |
binary |
Produce a binary ( |
vignettes, manual
|
For source packages: if |
args |
An optional character vector of additional command
line arguments to be passed to |
quiet |
if |
... |
Additional arguments passed to pkgbuild::build. |
DESCRIPTION entriesConfig/build/clean-inst-doc can be set to FALSE to avoid cleaning up
inst/doc when building a source package. Set it to TRUE to force a
cleanup. See the clean_doc argument.
Config/build/copy-method can be used to avoid copying large
directories in R CMD build. It works by copying (or linking) the
files of the package to a temporary directory, leaving out the
(possibly large) files that are not part of the package. Possible
values:
none: pkgbuild does not copy the package tree. This is the default.
copy: the package files are copied to a temporary directory before
R CMD build.
link: the package files are symbolic linked to a temporary
directory before R CMD build. Windows does not have symbolic
links, so on Windows this is equivalent to copy.
You can also use the pkg.build_copy_method option or the
PKG_BUILD_COPY_METHOD environment variable to set the copy method.
The option is consulted first, then the DESCRIPTION entry, then the
environment variable.
Config/build/extra-sources can be used to define extra source files
for pkgbuild to decide whether a package DLL needs to be recompiled in
needs_compile(). The syntax is a comma separated list of file names,
or globs. (See utils::glob2rx().) E.g. src/rust/src/*.rs or
configure*.
Config/build/bootstrap can be set to TRUE to run
Rscript bootstrap.R in the source directory prior to running subsequent
build steps.
Config/build/never-clean can be set to TRUE to never add --preclean
to R CMD INSTALL, e.g., when header files have changed.
This helps avoiding rebuilds that can take long for very large C/C++ codebases
and can lead to build failures if object files are out of sync with header files.
Control the dependencies between object files and header files
by adding include file.d to Makevars for each file.c or file.cpp source file.
pkg.build_copy_method: use this option to avoid copying large
directories when building a package. See possible values above, at the
Config/build/copy-method DESCRIPTION entry.
pkg.build_stop_for_warnings: if it is set to TRUE, then pkgbuild
will stop for R CMD build errors. It takes precedence over the
PKG_BUILD_STOP_FOR_WARNINGS environment variable.
PKG_BUILD_COLOR_DIAGNOSTICS: set it to false to opt out of colored
compiler diagnostics. Set it to true to force colored compiler
diagnostics.
PKG_BUILD_COPY_METHOD: use this environment variable to avoid copying
large directories when building a package. See possible values above,
at the Config/build/copy-method DESCRIPTION entry.
will stop for R CMD build errors. The pkg.build_stop_for_warnings
option takes precedence over this environment variable.
a string giving the location (including file name) of the built package
The default manual = FALSE is not suitable for a CRAN
submission, which may require manual = TRUE. Even better, use
submit_cran() or release().
Create package pdf manual
build_manual(pkg = ".", path = NULL)build_manual(pkg = ".", path = NULL)
pkg |
The package to use, can be a file path to the package or a
package object. See |
path |
path in which to produce package manual.
If |
Renders an executable README, i.e. README.qmd or README.Rmd, to
README.md. Specifically, build_readme():
Installs a copy of the package's current source to a temporary library
Renders the README in a clean R session
build_readme(path = ".", quiet = TRUE, ...)build_readme(path = ".", quiet = TRUE, ...)
path |
Path to the top-level directory of the source package. |
quiet |
If |
... |
Additional arguments passed to |
pkgdown::build_site()
This is a thin wrapper around pkgdown::build_site(), used for generating
static HTML documentation. Learn more at https://pkgdown.r-lib.org.
build_site(path = ".", ...)build_site(path = ".", ...)
path |
Path to the package to build the static HTML. |
... |
Additional arguments passed to |
check() automatically builds and checks a source package, using all known
best practices. check_built() checks an already-built package.
Passing R CMD check is essential if you want to submit your package to
CRAN: you must not have any ERRORs or WARNINGs, and you want to ensure that
there are as few NOTEs as possible. If you are not submitting to CRAN, at
least ensure that there are no ERRORs or WARNINGs: these typically represent
serious problems.
check() automatically builds a package before calling check_built(), as
this is the recommended way to check packages. Note that this process runs
in an independent R session, so nothing in your current workspace will affect
the process. Under-the-hood, check() and check_built() rely on
pkgbuild::build() and rcmdcheck::rcmdcheck().
check( pkg = ".", document = NULL, build_args = NULL, ..., manual = FALSE, cran = TRUE, remote = FALSE, incoming = remote, force_suggests = FALSE, run_dont_test = FALSE, args = "--timings", env_vars = c(NOT_CRAN = "true"), quiet = FALSE, check_dir = NULL, cleanup = deprecated(), vignettes = TRUE, error_on = c("never", "error", "warning", "note") ) check_built( path = NULL, cran = TRUE, remote = FALSE, incoming = remote, force_suggests = FALSE, run_dont_test = FALSE, manual = FALSE, args = "--timings", env_vars = NULL, check_dir = tempdir(), quiet = FALSE, error_on = c("never", "error", "warning", "note") )check( pkg = ".", document = NULL, build_args = NULL, ..., manual = FALSE, cran = TRUE, remote = FALSE, incoming = remote, force_suggests = FALSE, run_dont_test = FALSE, args = "--timings", env_vars = c(NOT_CRAN = "true"), quiet = FALSE, check_dir = NULL, cleanup = deprecated(), vignettes = TRUE, error_on = c("never", "error", "warning", "note") ) check_built( path = NULL, cran = TRUE, remote = FALSE, incoming = remote, force_suggests = FALSE, run_dont_test = FALSE, manual = FALSE, args = "--timings", env_vars = NULL, check_dir = tempdir(), quiet = FALSE, error_on = c("never", "error", "warning", "note") )
pkg |
The package to use, can be a file path to the package or a
package object. See |
document |
By default ( |
build_args |
Additional arguments passed to |
... |
Additional arguments passed on to |
manual |
If |
cran |
if |
remote |
Sets |
incoming |
Sets |
force_suggests |
Sets |
run_dont_test |
Sets |
args |
Character vector of arguments to pass to |
env_vars |
Environment variables set during |
quiet |
if |
check_dir |
Path to a directory where the check is performed.
If this is not |
cleanup |
|
vignettes |
If |
error_on |
Whether to throw an error on
|
path |
Path to built package. |
An object containing errors, warnings, notes, and more.
Devtools does its best to set up an environment that combines best practices with how check works on CRAN. This includes:
The standard environment variables set by devtools:
r_env_vars(). Of particular note for package tests is the NOT_CRAN env
var, which lets you know that your tests are running somewhere other than
CRAN, and hence can take a reasonable amount of time.
Debugging flags for the compiler, set by
compiler_flags(FALSE).
If aspell is found, _R_CHECK_CRAN_INCOMING_USE_ASPELL_
is set to TRUE. If no spell checker is installed, a warning is issued.
Environment variables, controlled by arguments incoming, remote and
force_suggests.
release() if you want to send the checked package to
CRAN.
Checks all Rd files in man/ and looks for any that have a \usage section
(i.e. a function) but that don't have \value and \examples sections.
These missing fields are flagged by CRAN on initial submission.
check_doc_fields(pkg = ".", fields = c("value", "examples"))check_doc_fields(pkg = ".", fields = c("value", "examples"))
pkg |
The package to use, can be a file path to the package or a
package object. See |
fields |
A character vector of Rd field names to check for. |
A named list of character vectors, one for each field, containing the names of Rd files missing that field. Returned invisibly.
## Not run: check_doc_fields(".") ## End(Not run)## Not run: check_doc_fields(".") ## End(Not run)
Check on either the released or development versions of R, using https://mac.r-project.org/macbuilder/submit.html.
check_mac_release( pkg = ".", dep_pkgs = character(), args = NULL, manual = TRUE, quiet = FALSE, ... ) check_mac_devel( pkg = ".", dep_pkgs = character(), args = NULL, manual = TRUE, quiet = FALSE, ... )check_mac_release( pkg = ".", dep_pkgs = character(), args = NULL, manual = TRUE, quiet = FALSE, ... ) check_mac_devel( pkg = ".", dep_pkgs = character(), args = NULL, manual = TRUE, quiet = FALSE, ... )
pkg |
The package to use, can be a file path to the package or a
package object. See |
dep_pkgs |
Additional custom dependencies to install prior to checking the package. |
args |
An optional character vector of additional command
line arguments to be passed to |
manual |
Should the manual be built? |
quiet |
If |
... |
Additional arguments passed to |
The url with the check results (invisibly)
Other build functions:
check_win()
R CMD check doesThis function attempts to run the documentation related checks in the
same way that R CMD check does. Unfortunately it can't run them
all because some tests require the package to be loaded, and the way
they attempt to load the code conflicts with how devtools does it.
check_man(pkg = ".")check_man(pkg = ".")
pkg |
The package to use, can be a file path to the package or a
package object. See |
Nothing. This function is called purely for it's side effects: if no errors there will be no output.
## Not run: check_man("mypkg") ## End(Not run)## Not run: check_man("mypkg") ## End(Not run)
This function first bundles a source package, then uploads it to
https://win-builder.r-project.org/. Once the service has built and checked
the package, an email is sent to address of the maintainer listed in
DESCRIPTION. This usually takes around 30 minutes. The email contains a
link to a directory with the package binary and check logs, which will be
deleted after a couple of days.
check_win_devel( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... ) check_win_release( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... ) check_win_oldrelease( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... )check_win_devel( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... ) check_win_release( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... ) check_win_oldrelease( pkg = ".", args = NULL, manual = TRUE, email = NULL, quiet = FALSE, webform = FALSE, ... )
pkg |
The package to use, can be a file path to the package or a
package object. See |
args |
An optional character vector of additional command
line arguments to be passed to |
manual |
Should the manual be built? |
email |
An alternative email address to use. If |
quiet |
If |
webform |
If |
... |
Additional arguments passed to |
check_win_devel(): Check package on the development version of R.
check_win_release(): Check package on the released version of R.
check_win_oldrelease(): Check package on the previous major release version of R.
Other build functions:
check_mac_release()
Call this function if things seem weird and you're not sure what's wrong or how to fix it. It reports:
If R is up to date.
If RStudio or Positron is up to date.
If compiler build tools are installed and available for use.
If devtools and its dependencies are up to date.
If the package's dependencies are up to date.
dev_sitrep(pkg = ".", debug = FALSE)dev_sitrep(pkg = ".", debug = FALSE)
pkg |
The package to use, can be a file path to the package or a
package object. See |
debug |
If |
A named list, with S3 class dev_sitrep (for printing purposes).
## Not run: dev_sitrep() ## End(Not run)## Not run: dev_sitrep() ## End(Not run)
This function is a wrapper for the roxygen2::roxygenize()
function from the roxygen2 package. See the documentation and vignettes of
that package to learn how to use roxygen.
document(pkg = ".", roclets = NULL, quiet = FALSE)document(pkg = ".", roclets = NULL, quiet = FALSE)
pkg |
The package to use, can be a file path to the package or a
package object. See |
roclets |
Character vector of roclet names to use with package.
The default, |
quiet |
if |
roxygen2::roxygenize(),
browseVignettes("roxygen2")
Uses R CMD INSTALL to install the package, after installing needed
dependencies with pak::local_install_deps().
To install to a non-default library, use withr::with_libpaths().
install( pkg = ".", reload = TRUE, quick = FALSE, build = !quick, args = getOption("devtools.install.args"), quiet = FALSE, dependencies = NA, upgrade = FALSE, build_vignettes = FALSE, keep_source = getOption("keep.source.pkgs") || !build, force = deprecated() )install( pkg = ".", reload = TRUE, quick = FALSE, build = !quick, args = getOption("devtools.install.args"), quiet = FALSE, dependencies = NA, upgrade = FALSE, build_vignettes = FALSE, keep_source = getOption("keep.source.pkgs") || !build, force = deprecated() )
pkg |
The package to use, can be a file path to the package or a
package object. See |
reload |
if |
quick |
if |
build |
If One downside of installing from a built tarball is that the package is
installed from a temporary location. This means that any source references
will point to dangling locations and debuggers won't have direct access to
the source for step-debugging. For development purposes, If |
args |
An optional character vector of additional command line
arguments to be passed to |
quiet |
If |
dependencies |
What kinds of dependencies to install. Most commonly one of the following values:
|
upgrade |
When When |
build_vignettes |
if |
keep_source |
If |
force |
with_debug() to install packages with debugging flags set.
Other package installation:
uninstall()
These functions are deprecated. Better alternatives:
pak::local_install_deps() instead of install_deps()
pak::local_install_dev_deps() instead of install_dev_deps()
install_deps( pkg = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"), ... ) install_dev_deps( pkg = ".", dependencies = TRUE, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"), ... )install_deps( pkg = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"), ... ) install_dev_deps( pkg = ".", dependencies = TRUE, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"), ... )
pkg |
The package to use, can be a file path to the package or a
package object. See |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
repos |
A character vector giving repositories to use. |
type |
Type of package to |
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
... |
Additional arguments passed to |
## Not run: install_deps(".")## Not run: install_deps(".")
The default linters correspond to the style guide at
https://style.tidyverse.org/, however it is possible to override any or all
of them using the linters parameter.
lint(pkg = ".", cache = TRUE, ...)lint(pkg = ".", cache = TRUE, ...)
pkg |
The package to use, can be a file path to the package or a
package object. See |
cache |
Store the lint results so repeated lints of the same content use the previous results. Consult the lintr package to learn more about its caching behaviour. |
... |
Additional arguments passed to |
lintr::lint_package(), lintr::lint()
load_all() loads a package. It roughly simulates what happens
when a package is installed and loaded with library(), without
having to first install the package. It:
Loads all data files in data/. See load_data() for more
details.
Sources all R files in the R directory, storing results in
environment that behaves like a regular package namespace. See
load_code() for more details.
Adds a shim from system.file() to shim_system.file() in
the imports environment of the package. This ensures that system.file()
works with both development and installed packages despite their differing
directory structures.
Adds shims from help() and ? to shim_help() and shim_question()
to make it easier to preview development documentation.
Compiles any C, C++, or Fortran code in the src/ directory and
connects the generated DLL into R. See pkgbuild::compile_dll()
for more details.
Loads any compiled translations in inst/po.
Runs .onAttach(), .onLoad() and .onUnload() functions at
the correct times.
If you use testthat, will load all test helpers so you can
access them interactively. devtools sets the DEVTOOLS_LOAD
environment variable to the package name to let you check whether the
helpers are run during package loading.
is_loading() returns TRUE when it is called while load_all()
is running. This may be useful e.g. in .onLoad hooks.
A package loaded with load_all() can be identified with
is_dev_package().
load_all( path = ".", reset = TRUE, recompile = FALSE, export_all = TRUE, helpers = TRUE, quiet = FALSE, ... )load_all( path = ".", reset = TRUE, recompile = FALSE, export_all = TRUE, helpers = TRUE, quiet = FALSE, ... )
path |
Path to a package, or within a package. |
reset |
|
recompile |
DEPRECATED. force a recompile of DLL from source code, if
present. This is equivalent to running |
export_all |
If |
helpers |
if |
quiet |
if |
... |
Additional arguments passed to |
load_all() tries its best to reproduce the behaviour of
loadNamespace() and library(). However it deviates from normal
package loading in several ways.
load_all() doesn't install the package to a library, so system.file()
doesn't work. pkgload fixes this for the package itself installing a shim,
shim_system.file(). However, this shim is not visible to third party
packages, so they will fail if they attempt to find files within your
package. One potential workaround is to use fs::path_package()
instead of system.file(), since that understands the mechanisms that
devtools uses to load packages.
load_all() loads all packages referenced in Imports at load time,
but loadNamespace() and library() only load package dependencies as
they are needed.
load_all() copies all objects (not just the ones listed as exports)
into the package environment. This is useful during development because
it makes internal objects easy to access. To export only the objects
listed as exports, use export_all = FALSE. This more closely simulates
behavior when loading an installed package with library(), and can
be useful for checking for missing exports.
load_all() delegates to pkgbuild::compile_dll() to perform the actual
compilation, during which by default some debug compiler flags are
appended. If you would like to produce an optimized build instead, you can
opt out by either using debug = FALSE, setting the pkg.build_extra_flags
option to FALSE, or setting the PKG_BUILD_EXTRA_FLAGS environment variable
to FALSE. For further details see the Details section in pkgbuild::compile_dll().
## Not run: # Load the package in the current directory load_all("./") # Running again loads changed files load_all("./") # With export_all=FALSE, only objects listed as exports in NAMESPACE # are exported load_all("./", export_all = FALSE) ## End(Not run)## Not run: # Load the package in the current directory load_all("./") # Running again loads changed files load_all("./") # With export_all=FALSE, only objects listed as exports in NAMESPACE # are exported load_all("./", export_all = FALSE) ## End(Not run)
release() is deprecated in favour of usethis::use_release_issue().
We no longer feel confident recommending release() because we don't use it
ourselves, so there's no guarantee that it will track best practices as
they evolve over time.
If you want to programmatical submit to CRAN, you can continue to use
submit_cran().
release(pkg = ".", check = FALSE, args = NULL)release(pkg = ".", check = FALSE, args = NULL)
pkg |
The package to use, can be a file path to the package or a
package object. See |
check |
if |
args |
An optional character vector of additional command
line arguments to be passed to |
usethis::use_release_issue() to create a checklist of release
tasks that you can use in addition to or in place of release.
One of the most frustrating parts of R CMD check is getting all of your
examples to pass - whenever one fails you need to fix the problem and then
restart the whole process. This function makes it a little easier by
making it possible to run all examples from an R function.
run_examples( pkg = ".", start = NULL, show = deprecated(), run_donttest = FALSE, run_dontrun = FALSE, fresh = FALSE, document = TRUE, run = deprecated(), test = deprecated() )run_examples( pkg = ".", start = NULL, show = deprecated(), run_donttest = FALSE, run_dontrun = FALSE, fresh = FALSE, document = TRUE, run = deprecated(), test = deprecated() )
pkg |
The package to use, can be a file path to the package or a
package object. See |
start |
Where to start running the examples: this can either be the
name of |
show |
DEPRECATED. |
run_donttest |
if |
run_dontrun |
if |
fresh |
if |
document |
if |
run, test
|
Deprecated, see |
pkgload::run_example() to run a single example.
Helper function wrapping IDE-specific calls to save all documents in the
active session. In this form, callers of save_all() don't need to
execute any IDE-specific code. This function can be extended to include
other IDE implementations of their equivalent
rstudioapi::documentSaveAll() methods.
save_all()save_all()
“Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.” https://gist.github.com/
source_gist(id, ..., filename = NULL, sha1 = NULL, quiet = FALSE)source_gist(id, ..., filename = NULL, sha1 = NULL, quiet = FALSE)
id |
either full url (character), gist ID (numeric or character of numeric). |
... |
other options passed to |
filename |
if there is more than one R file in the gist, which one to
source (filename ending in '.R')? Default |
sha1 |
The SHA-1 hash of the file at the remote URL. This is highly
recommend as it prevents you from accidentally running code that's not
what you expect. See |
quiet |
if |
## Not run: # You can run gists given their id source_gist(6872663) source_gist("6872663") # Or their html url source_gist("https://gist.github.com/hadley/6872663") source_gist("gist.github.com/hadley/6872663") # It's highly recommend that you run source_gist with the optional # sha1 argument - this will throw an error if the file has changed since # you first ran it source_gist(6872663, sha1 = "54f1db27e60") # Wrong hash will result in error source_gist(6872663, sha1 = "54f1db27e61") #' # You can speficy a particular R file in the gist source_gist(6872663, filename = "hi.r") source_gist(6872663, filename = "hi.r", sha1 = "54f1db27e60") ## End(Not run)## Not run: # You can run gists given their id source_gist(6872663) source_gist("6872663") # Or their html url source_gist("https://gist.github.com/hadley/6872663") source_gist("gist.github.com/hadley/6872663") # It's highly recommend that you run source_gist with the optional # sha1 argument - this will throw an error if the file has changed since # you first ran it source_gist(6872663, sha1 = "54f1db27e60") # Wrong hash will result in error source_gist(6872663, sha1 = "54f1db27e61") #' # You can speficy a particular R file in the gist source_gist(6872663, filename = "hi.r") source_gist(6872663, filename = "hi.r", sha1 = "54f1db27e60") ## End(Not run)
If a SHA-1 hash is specified with the sha1 argument, then this
function will check the SHA-1 hash of the downloaded file to make sure it
matches the expected value, and throw an error if it does not match. If the
SHA-1 hash is not specified, it will print a message displaying the hash of
the downloaded file. The purpose of this is to improve security when running
remotely-hosted code; if you have a hash of the file, you can be sure that
it has not changed. For convenience, it is possible to use a truncated SHA1
hash, down to 6 characters, but keep in mind that a truncated hash won't be
as secure as the full hash.
source_url(url, ..., sha1 = NULL)source_url(url, ..., sha1 = NULL)
url |
url |
... |
other options passed to |
sha1 |
The (prefix of the) SHA-1 hash of the file at the remote URL. |
## Not run: source_url("https://gist.github.com/hadley/6872663/raw/hi.r") # With a hash, to make sure the remote file hasn't changed source_url("https://gist.github.com/hadley/6872663/raw/hi.r", sha1 = "54f1db27e60bb7e0486d785604909b49e8fef9f9") # With a truncated hash source_url("https://gist.github.com/hadley/6872663/raw/hi.r", sha1 = "54f1db27e60") ## End(Not run)## Not run: source_url("https://gist.github.com/hadley/6872663/raw/hi.r") # With a hash, to make sure the remote file hasn't changed source_url("https://gist.github.com/hadley/6872663/raw/hi.r", sha1 = "54f1db27e60bb7e0486d785604909b49e8fef9f9") # With a truncated hash source_url("https://gist.github.com/hadley/6872663/raw/hi.r", sha1 = "54f1db27e60") ## End(Not run)
Runs a spell check on text fields in the package description file, manual pages, and optionally vignettes. Wraps the spelling package.
spell_check(pkg = ".", vignettes = TRUE, use_wordlist = TRUE)spell_check(pkg = ".", vignettes = TRUE, use_wordlist = TRUE)
pkg |
The package to use, can be a file path to the package or a
package object. See |
vignettes |
also check all |
use_wordlist |
ignore words in the package WORDLIST file |
test() runs all tests in a package. It's a shortcut for
testthat::test_dir()
test_active_file() runs test() on the active file.
test_coverage() computes test coverage for your package. It's a
shortcut for covr::package_coverage() plus covr::report().
test_coverage_active_file() computes test coverage for the active file. It's a
shortcut for covr::file_coverage() plus covr::report().
test(pkg = ".", filter = NULL, stop_on_failure = FALSE, export_all = TRUE, ...) test_active_file(file = find_active_file(), ...) test_coverage(pkg = ".", report = NULL, ...) test_coverage_active_file( file = find_active_file(), filter = TRUE, report = NULL, export_all = TRUE, ... )test(pkg = ".", filter = NULL, stop_on_failure = FALSE, export_all = TRUE, ...) test_active_file(file = find_active_file(), ...) test_coverage(pkg = ".", report = NULL, ...) test_coverage_active_file( file = find_active_file(), filter = TRUE, report = NULL, export_all = TRUE, ... )
pkg |
The package to use, can be a file path to the package or a
package object. See |
filter |
If not |
stop_on_failure |
If |
export_all |
If |
... |
additional arguments passed to wrapped functions. |
file |
One or more source or test files. If a source file the corresponding test file will be run. The default is to use the active file in RStudio (if available). |
report |
How to display the coverage report.
Defaults to |
Uses remove.packages() to uninstall the package. To uninstall a package
from a non-default library, use in combination with withr::with_libpaths().
uninstall(pkg = ".", unload = TRUE, quiet = FALSE, lib = .libPaths()[[1]])uninstall(pkg = ".", unload = TRUE, quiet = FALSE, lib = .libPaths()[[1]])
pkg |
The package to use, can be a file path to the package or a
package object. See |
unload |
if |
quiet |
If |
lib |
a character vector giving the library directories to remove the
packages from. If missing, defaults to the first element in
|
with_debug() to install packages with debugging flags set.
Other package installation:
install()