This vignette describes the Workflow for Open Reproducible Code in Science, as introduced in Van Lissa et al. (2021). The paper describes the rationale and principled approach on which the workflow is based; this vignette describes the practical steps for R-users in greater detail. Note that, although the steps are numbered for reference purposes, we acknowledge that the process of conducting research is not always linear. The workflow is illustrated in the graph below, with optional steps displayed in blue nodes:
https://github.com/username/repository.git
https://github.com/username/repository.git
renv
checked if you want to use
dependency management (recommended)add_preregistration()
add_manuscript()
preregistration.Rmd
file, and
optionally, planned analyses in a .R
file.prepare_data.R
file.open_data()
or
closed_data()
Manuscript.Rmd
load_data()
git_update("Describe the changes made since the last commit")
to Add all new files (not blocked by .gitignore
), Commit
them, and Push the changes to a remote repository, all in one step[@essentialref2020]
, and non-essential references with a
double at-symbol, [@@nonessential2020]
.renv
, you can save the state of
the project library (all packages used) by calling
renv::snapshot()
. This updates the lockfile,
renv.lock
.check_worcs()
function to see whether your
project adheres to the WORCS checklist (see
worcs::checklist
)
knit: worcs::cite_all
to
knit: worcs::cite_essential
Some researchers might want to share their work only once the paper is accepted for publication. In this case, we recommend creating a “Private” repository in Step 1, and completing Steps 13-18 upon acceptance by the journal.
Image attribution
The Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License. The OSF logo is licensed under CC0 1.0 Universal. Icons in the workflow graph are obtained from Flaticon; see detailed attribution.
For a list of sample worcs
projects created by the
authors and other users, see the README.md
file
on the WORCS GitHub page. This list is regularly updated.
References