Skip to contents

Prerequisites

High level overview of the package

rcompendium-package rcompendium
Create a package or research compendium structure

Setup functions

These four functions are usually the only ones user needs to run. The use of set_credentials is strongly recommended to permanently store user information (name, email, orcid, etc.) in the .Rprofile. This function must be run one time. The function create_new_package must be used to create an R package structure whereas create_new_compendium creates a new research compendium structure (i.e. R package structure with some additional files/folders). After that user can start to develop his/her project and frequently update the package/compendium components (Rd files, NAMESPACE, dependencies, badges, README.md, etc.)

set_credentials()
Store user information in the .Rprofile
create_new_package()
Create an R package structure
create_new_compendium()
Create an R compendium structure

Create files

These function write files specific to R package and research compendium (add_makefile). They are called by the main functions create_new_package and create_new_compendium but they also can be used to overwrite files (with overwrite = TRUE) in case of broken code. When open = TRUE and overwrite = FALSE (default) files are open in the editor.

add_description()
Add a DESCRIPTION file
add_license()
Add a LICENSE file
add_package_doc()
Create a package-level documentation file
add_citation()
Create a CITATION file
add_code_of_conduct()
Add a CODE OF CONDUCT file
add_contributing()
Add a CONTRIBUTING file
add_codeowners()
Create a CODEOWNERS file
add_issue_template()
Set up an Issue Template file
add_testthat()
Initialize units tests
add_vignette()
Create a vignette document
add_readme_rmd()
Create a README file
add_compendium()
Create additional folders
add_makefile()
Create a Make-like R file
add_renv()
Initialize renv
add_dockerfile()
Create a Dockerfile

README badges

These functions add badges to the README.Rmd. They are called by the main functions create_new_package and create_new_compendium but they also can be used to update badges if license, lifecycle, repository status change or to update number of dependencies (add_dependencies_badge).

add_cran_version_badge()
Add a CRAN version badge
add_cran_downloads_badge()
Add CRAN monthly downloads badge
add_cran_total_download_badge()
Add CRAN total download badge
add_dependencies_badge()
Add a Dependencies badge
add_license_badge()
Add a License badge
add_lifecycle_badge()
Add a Life Cycle badge
add_repostatus_badge()
Add a Repository Status badge
add_github_actions_check_badge()
Add a R CMD Check badge
add_github_actions_pkgdown_badge()
Add a Website badge
add_github_actions_codecov_badge()
Add a Test coverage badge
add_codecov_badge()
Add a Codecov badge

Advanced functions

These functions update fields in DESCRIPTION (add_dependencies and add_r_depend), edit files (add_to_gitignore and add_to_buildignore), or write configuration files (add_github_actions_check, add_github_actions_pkgdown, add_github_actions_codecov, and add_github_actions_render).

add_dependencies()
Add dependencies in DESCRIPTION
add_r_depend()
Add minimal R version to DESCRIPTION
add_to_gitignore()
Add to the .gitignore file
add_to_buildignore()
Add to the .Rbuildignore file
add_github_action()
Set up a GitHub Action workflow
add_dependabot()
Add a DEPENDABOT file

Utilities functions

These functions return objects but do not edit any file.

get_licenses()
List all available licenses
get_all_dependencies()
Get all external dependencies
get_all_functions()
List all functions in the package
get_available_gh_actions()
List available GitHub Actions
get_available_issue_templates()
List available ISSUE TEMPLATE
get_minimal_r_version()
Get required minimal R version