Learn R Programming

rcompendium

In the area of open science, making reproducible analyses is a strong prerequisite. But sometimes it is difficult 1) to find the good structure to organize files and 2) to set up the whole project. The aim of the package rcompendium is to make easier the creation of R package/research compendium (i.e. a predefined files/folders structure) so that users can focus on the code/analysis instead of wasting time organizing files.

A full ready-to-work structure will be set up with the following features:

  • Initialization of version control with git.
  • Creation of a minimal R package structure (DESCRIPTION and NAMESPACE files, and R/ and man/ folders).
  • Creation of additional files (LICENSE.md, inst/CITATION, etc.).
  • Creation of a Get started vignette in vignettes/ (package only).
  • Setting the units tests process in tests/.
  • Creation of a README.Rmd with HexSticker (template) and badges.
  • Autocompletion of maintainer information.
  • Initialization of the renv system (if required).
  • Creation of a Dockerfile (if required).
  • Creation of a GitHub repository.
  • Configuration of GitHub Actions to automatically:
    • check and test package (R CMD Check);
    • report the code coverage (covr);
    • build and deploy website (pkgdown);
    • render README.md.

This package heavily relies on the R packages devtools and usethis and follows recommendations made by Hadley Wickham & Jenny Bryan and Ben Marwick.

Installation

You can install the stable version from CRAN with:

## Install stable version of < rcompendium > from CRAN ----
install.packages("rcompendium")

Or you can install the development version from GitHub with:

## Install < remotes > package (if not already installed) ----
if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

## Install dev version of < rcompendium > from GitHub ----
remotes::install_github("FRBCesab/rcompendium")

Note: On Unix system you may have an error during the installation linked to the V8 JavaScript engine. This software is required by the R package cffr (included in rcompendium). Run the following line and try to reinstall rcompendium.

## Fix V8 issues ----
Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)

## Install < rcompendium > ----
install.packages("rcompendium")

Usage

Please read the Get started vignette and pay attention to the sections Prerequisites and Usage

Others available vignettes:

Citation

Please cite this package as:

Casajus N. (2023) rcompendium: An R package to create a package or research compendium structure. Version 1.3, https://github.com/FRBCesab/rcompendium.

You can also run:

citation("rcompendium")

## A BibTeX entry for LaTeX users is:
## 
## @Manual{,
##   title  = {{rcompendium}: {An} {R} package to create a package or research compendium structure},
##   author = {{Casajus N.}},
##   year   = {2023},
##   note   = {R package version 1.3},
##   url    = {https://github.com/FRBCesab/rcompendium},
## }

Contributing

All types of contributions are encouraged and valued. For more information, check out our Contribution Guidelines.

Please note that the rcompendium project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Colophon

This package is the result of intense discussions and feedbacks from the training course Reproducible Research in Computational Ecology.

rcompendium is largely inspired by the package rrtools developed by Ben Marwick et al. and tries to respect the standard defined by the community.

Copy Link

Version

Install

install.packages('rcompendium')

Monthly Downloads

785

Version

1.3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Nicolas Casajus

Last Published

October 26th, 2023

Functions in rcompendium (1.3)

add_github_actions_check_badge

Add a R CMD Check badge
add_license_badge

Add a License badge
add_to_buildignore

Add to the .Rbuildignore file
add_testthat

Initialize units tests
add_renv

Initialize renv
add_repostatus_badge

Add a Repository Status badge
add_readme_rmd

Create a README file
add_r_depend

Add minimal R version to DESCRIPTION
add_makefile

Create a Make-like R file
add_package_doc

Create a package-level documentation file
add_to_gitignore

Add to the .gitignore file
get_all_dependencies

Get all external dependencies
add_vignette

Create a vignette document
rcompendium-package

Create a package or research compendium structure
refresh

Refresh a package/research compendium
add_lifecycle_badge

Add a Life Cycle badge
get_all_functions

List all functions in the package
get_minimal_r_version

Get required minimal R version
new_compendium

Create an R compendium structure
set_credentials

Store credentials to the .Rprofile
new_package

Create an R package structure
get_licenses

List all available licenses
add_dependencies_badge

Add a Dependencies badge
add_dependencies

Add dependencies in DESCRIPTION
add_cran_badge

Add a CRAN Status badge
add_citation

Create a CITATION file
add_dockerfile

Create a Dockerfile
add_compendium

Create additional folders
add_codecov_badge

Add a Codecov badge
add_contributing

Add contribution guidelines
add_code_of_conduct

Add code of conduct
add_description

Create a DESCRIPTION file
add_github_actions_citation

Setup GitHub Actions to update CITATION.cff
add_github_actions_render

Setup GitHub Actions to render README
add_github_actions_check

Setup GitHub Actions to check package
add_license

Add a LICENSE
add_github_actions_pkgdown

Setup GitHub Actions to build and deploy package website
add_github_actions_pkgdown_badge

Add a Website badge
add_github_actions_codecov_badge

Add a Test coverage badge
add_github_actions_document

Setup GitHub Actions to document package
add_github_actions_codecov

Setup GitHub Actions to report code coverage