Run routine checks on the package:
Clean DESCRIPTION with
usethis::use_tidy_description()Compress the data of the paths
"./data"and"./R"usingtools::resaveRdaFiles().Style code with
styler::style_pkg()Check urls with
urlchecker::url_check()Roxygenise with
roxygen2::roxygenise()Precompute vignettes if present (see https://ropensci.org/blog/2019/12/08/precompute-vignettes/)
Rebuild
README.Rmd(if present) withdevtools::build_readme()Optimize images with
resmush::resmush_dir()Write codemeta.json with
codemetar::write_codemeta()Write CITATION.cff with
cffr::cff_write()
Usage
update_docs(
pkg = ".",
url_update = TRUE,
create_codemeta = TRUE,
create_cff = TRUE,
build_readme = TRUE,
verbose = TRUE,
precompute = TRUE,
opt_imgs = TRUE,
opt_dir = c("pkgdown/favicon", "man/figures", "vignettes"),
opt_ext = "png$|jpg$",
opt_overwrite = TRUE,
add_contributors = TRUE,
...
)Arguments
- pkg
Path to a (subdirectory of an) R package.
- url_update
Logical, do you want to update urls with
urlchecker::url_update()?- create_codemeta
Logical, do you want to create a codemeta file with
codemetar::write_codemeta()?- create_cff
Logical, do you want to create a CITATION.cff file with
cffr::cff_write()?- build_readme
Logical, build
README.Rmdwithdevtools::build_readme()- verbose
Display informative messages on the console
- precompute
Logical, detect and precompute vignettes? See also
precompute_vignette().- opt_imgs
Logical. Optimize images with
resmush::resmush_dir()?- opt_dir, opt_ext, opt_overwrite
See
dir,extandoverwriteinresmush::resmush_dir().- add_contributors
Logical. Would add contributors using
allcontributors::add_contributors().- ...
Additional arguments to functions
Details
This function tries to update and clean the package following a mix of
best practices (e.g. checking the urls, roxygenise and rebuilding the
README) and some other discretionary practices I like to have in a package,
as the tidyverse approach for the DESCRIPTION file and overall code
and the use of codemeta.json.
