Contributing

Overview

GitHub: This section explains how to get the source code from Github to work on this project.

RStudio Project: This section explains how to use RStudio Project to work on this project.

Quarto: This section explains how to use Quarto to work on this project.

Dependency Management: This section explains how this project manages package dependencies using renv.

Code: This section explains how to add code snippets.

Images: This section e explains how to add images.

References: This section explains how to add references.

Variables: This section explains how to use variables.

Fontawesome Icons: This section explains how to add icons.

GitHub

This book is developed with Git and within the GitHub-environment. You can download the source code from GitHub by clicking on the Code-Button. You must then press either Open with GitHub Desktop (requires GitHub Desktop) or Download ZIP. For a detailed introduction on Git and GitHub see this Version Control Book. For an overview about the project structure of this Reproducibility Book, look at the README.md-file on GitHub.

RStudio Project

We recommend working in RStudio and open the RStudio Project.

  • Double-click on the project file repro-book.Rproj within your computer’s file system (for example, macOS Finder).

In the Terminal, run:

open repro-book.Rproj

This will open the RStudio Project in RStudio.

Click here to view the full repro-book.Rproj file of this project.
repro-book.Rproj
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Makefile

MarkdownWrap: Sentence

Quarto

This book is made with Quarto.

Local development

Setup

  1. Read the Get Started chapter of the Quarto documentation, which includes details on installation.

Preparation

  1. Read this guide on how to contribute.
  2. Familiarize yourself with Quarto Books.

Local preview

quarto preview

Add a new chapter

  1. Create a new Quarto document inside the /chapters/ folder.
  2. Add the new chapter to _quarto.yml. Don’t forget to specify the full path (including chapters/).
_quarto.yml (excerpt)
chapters:
  - index.qmd
1  - chapters/YOUR-NEW-CHAPTER.qmd
  - another-chapter.qmd
1
Replace YOUR-NEW-CHAPTER with a concise filename.
Click here to view the full _quarto.yml file of this project.
_quarto.yml
project:
  type: book
  execute-dir: project
  output-dir: _book
  preview: 
    port: 7777
    host: 127.0.0.1
    browser: true
    watch-inputs: true
    navigate: true

book:
  # book:
  title: "The Repro Book"
  subtitle: "A Guide to Reproducible Research"
  # favicon: static/logo.svg
  site-url: https://lennartwittkuhn.com/repro-book/
  repo-url: https://github.com/lnnrtwttkhn/repro-book/
  repo-branch: main
  issue-url: https://github.com/lnnrtwttkhn/repro-book/issues
  repo-actions: [edit, issue, source]
  page-navigation: true
  back-to-top-navigation: true
  search: true
  twitter-card: false
  chapters:
    - index.qmd
    - contents.qmd
    - chapters/intro.qmd
    - chapters/motivation-for-reproducibility.qmd
    - chapters/naming-things.qmd
    - chapters/project-structure.qmd
    - chapters/rdm.qmd
    - chapters/good-coding-practices.qmd
    - chapters/renv.qmd
    - summary.qmd
    - references.qmd
    - acknowledgements.qmd
    - contributing.qmd
  sidebar:
    id: sidebar
    title: "{{< var project.title >}}"
    # logo: static/logo.svg
    search: true
    tools:
      - icon: globe
        href: https://lennartwittkuhn.com/repro-book/
      - icon: bug
        href: https://github.com/lnnrtwttkhn/repro-book/
    style: floating
    type: light
    border: false
    alignment: center
    collapse-level: 2
    pinned: true
    footer: |
      [![Website](https://img.shields.io/website?url=https%3A%2F%2Flennartwittkuhn.com%2Frepro-book%2F)]({{< var project.site-url >}})
      [![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
      [![Quarto Publish]({{< var project.repo-url >}}/actions/workflows/publish.yml/badge.svg)]({{< var project.repo-url >}}/actions/workflows/publish.yml)
      [![Codespell]({{< var project.repo-url >}}/actions/workflows/codespell.yml/badge.svg)]({{< var project.repo-url >}}/actions/workflows/codespell.yml)
      [![All Contributors](https://img.shields.io/github/all-contributors/projectOwner/projectName?color=ee8449&style=flat-square)]({{< var project.contributors-url >}})
  page-footer:
    left: |
      &copy; {{< var project.duration >}} [{{< var project.title >}} Team]({{< var project.contributors-url >}})
    center:
      - text: "Acknowledgements"
        href: acknowledgements.qmd
    right: |
      License: {{< var project.license-short >}}
    border: false
    background: light

toc: true
toc-depth: 3
toc-location: right
toc-title: "Contents"
number-sections: true
number-depth: 4
cap-location: bottom
code-line-numbers: false
code-annotations: below
highlight-style: monokai
reference-location: document  
lang: en-US  
bibliography: references.bib
citations-hover: true
citation-location: document
citeproc: true
from: markdown+emoji
license: CC BY
abstract-title: "Summary"
metadata-files:
  - _images.yml

format:
  html:
    theme: [default, custom.scss]
    anchor-sections: true
    smooth-scroll: true
    toc-expand: 2
    page-layout: full
    title-block-style: default
    code-fold: false
    code-overflow: scroll
    code-copy: true
    code-link: false
    code-tools: false
    link-external-newwindow: true
    footnotes-hover: true
    include-after-body: plausible.html
    crossref:
      custom:
        - kind: float
          reference-prefix: Video
          key: vid

Dependency Management

We use renv for project-local dependency management. For details on renv, see the renv documentation.

Using renv for the first time

After you open the Rstudio Project, you will (hopefully) see a similar output in the RStudio console:

Output
# Bootstrapping renv 0.17.3 --------------------------------------------------
* Downloading renv 0.17.3 ... OK (downloaded binary)
* Installing renv 0.17.3 ... Done!
* Successfully installed and loaded renv 0.17.3.
* Project '~/repro-book' loaded. [renv 0.17.3]
* This project contains a lockfile, but none of the recorded packages are installed.
* Use `renv::restore()` to restore the project library.

This output tells you that (1) renv was automatically installed and loaded, (2) the renv environment for the project was loaded, and (3) that none of packages recorded in the renv lockfile are installed.

The renv lockfile captures the state of the package library of the project at some point in time. It is defining the version of renv used when generating the lockfile, the version of used in that project, the R repositories that were active when the lockfile was created and the package records defining each package, their version, and their installation source. For details on the anatomy of renv.lock, see this section in the renv documentation.

Click here to view the full renv.lock file of this project.
renv.lock
{
  "R": {
    "Version": "4.4.1",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://packagemanager.posit.co/cran/latest"
      }
    ]
  },
  "Packages": {
    "MASS": {
      "Package": "MASS",
      "Version": "7.3-61",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "0cafd6f0500e5deba33be22c46bf6055"
    },
    "R6": {
      "Package": "R6",
      "Version": "2.5.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "470851b6d5d0ac559e9d01bb352b4021"
    },
    "assertr": {
      "Package": "assertr",
      "Version": "3.0.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "MASS",
        "R",
        "dplyr",
        "methods",
        "rlang",
        "stats",
        "utils"
      ],
      "Hash": "dd34511e88d11c95e80f8d9bb0606e79"
    },
    "backports": {
      "Package": "backports",
      "Version": "1.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "e1e1b9d75c37401117b636b7ae50827a"
    },
    "base64enc": {
      "Package": "base64enc",
      "Version": "0.1-3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "543776ae6848fde2f48ff3816d0628bc"
    },
    "bslib": {
      "Package": "bslib",
      "Version": "0.8.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "base64enc",
        "cachem",
        "fastmap",
        "grDevices",
        "htmltools",
        "jquerylib",
        "jsonlite",
        "lifecycle",
        "memoise",
        "mime",
        "rlang",
        "sass"
      ],
      "Hash": "b299c6741ca9746fb227debcb0f9fb6c"
    },
    "cachem": {
      "Package": "cachem",
      "Version": "1.1.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "fastmap",
        "rlang"
      ],
      "Hash": "cd9a672193789068eb5a2aad65a0dedf"
    },
    "callr": {
      "Package": "callr",
      "Version": "3.7.6",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "processx",
        "utils"
      ],
      "Hash": "d7e13f49c19103ece9e58ad2d83a7354"
    },
    "cli": {
      "Package": "cli",
      "Version": "3.6.3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "b21916dd77a27642b447374a5d30ecf3"
    },
    "codetools": {
      "Package": "codetools",
      "Version": "0.2-20",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "61e097f35917d342622f21cdc79c256e"
    },
    "cpp11": {
      "Package": "cpp11",
      "Version": "0.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "91570bba75d0c9d3f1040c835cee8fba"
    },
    "crayon": {
      "Package": "crayon",
      "Version": "1.5.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "grDevices",
        "methods",
        "utils"
      ],
      "Hash": "859d96e65ef198fd43e82b9628d593ef"
    },
    "cyclocomp": {
      "Package": "cyclocomp",
      "Version": "1.1.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "callr",
        "crayon",
        "desc",
        "remotes",
        "withr"
      ],
      "Hash": "cdc4a473222b0112d4df0bcfbed12d44"
    },
    "data.table": {
      "Package": "data.table",
      "Version": "1.16.2",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "2e00b378fc3be69c865120d9f313039a"
    },
    "desc": {
      "Package": "desc",
      "Version": "1.4.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "utils"
      ],
      "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f"
    },
    "digest": {
      "Package": "digest",
      "Version": "0.6.37",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "33698c4b3127fc9f506654607fb73676"
    },
    "dplyr": {
      "Package": "dplyr",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "R6",
        "cli",
        "generics",
        "glue",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "rlang",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "fedd9d00c2944ff00a0e2696ccf048ec"
    },
    "evaluate": {
      "Package": "evaluate",
      "Version": "1.0.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "3fd29944b231036ad67c3edb32e02201"
    },
    "fansi": {
      "Package": "fansi",
      "Version": "1.0.6",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "utils"
      ],
      "Hash": "962174cf2aeb5b9eea581522286a911f"
    },
    "fastmap": {
      "Package": "fastmap",
      "Version": "1.2.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
    },
    "fontawesome": {
      "Package": "fontawesome",
      "Version": "0.5.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "htmltools",
        "rlang"
      ],
      "Hash": "bd1297f9b5b1fc1372d19e2c4cd82215"
    },
    "fs": {
      "Package": "fs",
      "Version": "1.6.5",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "7f48af39fa27711ea5fbd183b399920d"
    },
    "generics": {
      "Package": "generics",
      "Version": "0.1.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "15e9634c0fcd294799e9b2e929ed1b86"
    },
    "glue": {
      "Package": "glue",
      "Version": "1.8.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "5899f1eaa825580172bb56c08266f37c"
    },
    "here": {
      "Package": "here",
      "Version": "1.0.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "rprojroot"
      ],
      "Hash": "24b224366f9c2e7534d2344d10d59211"
    },
    "highr": {
      "Package": "highr",
      "Version": "0.11",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "xfun"
      ],
      "Hash": "d65ba49117ca223614f71b60d85b8ab7"
    },
    "htmltools": {
      "Package": "htmltools",
      "Version": "0.5.8.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "base64enc",
        "digest",
        "fastmap",
        "grDevices",
        "rlang",
        "utils"
      ],
      "Hash": "81d371a9cc60640e74e4ab6ac46dcedc"
    },
    "htmlwidgets": {
      "Package": "htmlwidgets",
      "Version": "1.6.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "grDevices",
        "htmltools",
        "jsonlite",
        "knitr",
        "rmarkdown",
        "yaml"
      ],
      "Hash": "04291cc45198225444a397606810ac37"
    },
    "jquerylib": {
      "Package": "jquerylib",
      "Version": "0.1.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "htmltools"
      ],
      "Hash": "5aab57a3bd297eee1c1d862735972182"
    },
    "jsonlite": {
      "Package": "jsonlite",
      "Version": "1.8.9",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "methods"
      ],
      "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b"
    },
    "knitr": {
      "Package": "knitr",
      "Version": "1.49",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "evaluate",
        "highr",
        "methods",
        "tools",
        "xfun",
        "yaml"
      ],
      "Hash": "9fcb189926d93c636dea94fbe4f44480"
    },
    "lazyeval": {
      "Package": "lazyeval",
      "Version": "0.2.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "d908914ae53b04d4c0c0fd72ecc35370"
    },
    "lifecycle": {
      "Package": "lifecycle",
      "Version": "1.0.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "rlang"
      ],
      "Hash": "b8552d117e1b808b09a832f589b79035"
    },
    "lintr": {
      "Package": "lintr",
      "Version": "3.1.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "backports",
        "codetools",
        "cyclocomp",
        "digest",
        "glue",
        "knitr",
        "rex",
        "stats",
        "utils",
        "xml2",
        "xmlparsedata"
      ],
      "Hash": "08cff46381a242d44c0d8dd0aabd9f71"
    },
    "magrittr": {
      "Package": "magrittr",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "7ce2733a9826b3aeb1775d56fd305472"
    },
    "memoise": {
      "Package": "memoise",
      "Version": "2.0.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "cachem",
        "rlang"
      ],
      "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c"
    },
    "mime": {
      "Package": "mime",
      "Version": "0.12",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "tools"
      ],
      "Hash": "18e9c28c1d3ca1560ce30658b22ce104"
    },
    "pillar": {
      "Package": "pillar",
      "Version": "1.9.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "cli",
        "fansi",
        "glue",
        "lifecycle",
        "rlang",
        "utf8",
        "utils",
        "vctrs"
      ],
      "Hash": "15da5a8412f317beeee6175fbc76f4bb"
    },
    "pkgconfig": {
      "Package": "pkgconfig",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "utils"
      ],
      "Hash": "01f28d4278f15c76cddbea05899c5d6f"
    },
    "processx": {
      "Package": "processx",
      "Version": "3.8.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "R6",
        "ps",
        "utils"
      ],
      "Hash": "0c90a7d71988856bad2a2a45dd871bb9"
    },
    "ps": {
      "Package": "ps",
      "Version": "1.8.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "b4404b1de13758dea1c0484ad0d48563"
    },
    "purrr": {
      "Package": "purrr",
      "Version": "1.0.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "lifecycle",
        "magrittr",
        "rlang",
        "vctrs"
      ],
      "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc"
    },
    "rappdirs": {
      "Package": "rappdirs",
      "Version": "0.3.3",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "5e3c5dc0b071b21fa128676560dbe94d"
    },
    "remotes": {
      "Package": "remotes",
      "Version": "2.5.0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "methods",
        "stats",
        "tools",
        "utils"
      ],
      "Hash": "3ee025083e66f18db6cf27b56e23e141"
    },
    "renv": {
      "Package": "renv",
      "Version": "1.0.11",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "utils"
      ],
      "Hash": "47623f66b4e80b3b0587bc5d7b309888"
    },
    "rex": {
      "Package": "rex",
      "Version": "1.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "lazyeval"
      ],
      "Hash": "ae34cd56890607370665bee5bd17812f"
    },
    "rlang": {
      "Package": "rlang",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
    },
    "rmarkdown": {
      "Package": "rmarkdown",
      "Version": "2.29",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "bslib",
        "evaluate",
        "fontawesome",
        "htmltools",
        "jquerylib",
        "jsonlite",
        "knitr",
        "methods",
        "tinytex",
        "tools",
        "utils",
        "xfun",
        "yaml"
      ],
      "Hash": "df99277f63d01c34e95e3d2f06a79736"
    },
    "rprojroot": {
      "Package": "rprojroot",
      "Version": "2.0.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "4c8415e0ec1e29f3f4f6fc108bef0144"
    },
    "sass": {
      "Package": "sass",
      "Version": "0.4.9",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R6",
        "fs",
        "htmltools",
        "rappdirs",
        "rlang"
      ],
      "Hash": "d53dbfddf695303ea4ad66f86e99b95d"
    },
    "stringi": {
      "Package": "stringi",
      "Version": "1.8.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "stats",
        "tools",
        "utils"
      ],
      "Hash": "39e1144fd75428983dc3f63aa53dfa91"
    },
    "stringr": {
      "Package": "stringr",
      "Version": "1.5.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "magrittr",
        "rlang",
        "stringi",
        "vctrs"
      ],
      "Hash": "960e2ae9e09656611e0b8214ad543207"
    },
    "tibble": {
      "Package": "tibble",
      "Version": "3.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "fansi",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "pkgconfig",
        "rlang",
        "utils",
        "vctrs"
      ],
      "Hash": "a84e2cc86d07289b3b6f5069df7a004c"
    },
    "tidyr": {
      "Package": "tidyr",
      "Version": "1.3.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "cpp11",
        "dplyr",
        "glue",
        "lifecycle",
        "magrittr",
        "purrr",
        "rlang",
        "stringr",
        "tibble",
        "tidyselect",
        "utils",
        "vctrs"
      ],
      "Hash": "915fb7ce036c22a6a33b5a8adb712eb1"
    },
    "tidyselect": {
      "Package": "tidyselect",
      "Version": "1.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang",
        "vctrs",
        "withr"
      ],
      "Hash": "829f27b9c4919c16b593794a6344d6c0"
    },
    "tinytex": {
      "Package": "tinytex",
      "Version": "0.54",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "xfun"
      ],
      "Hash": "3ec7e3ddcacc2d34a9046941222bf94d"
    },
    "utf8": {
      "Package": "utf8",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "62b65c52671e6665f803ff02954446e9"
    },
    "vctrs": {
      "Package": "vctrs",
      "Version": "0.6.5",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang"
      ],
      "Hash": "c03fa420630029418f7e6da3667aac4a"
    },
    "withr": {
      "Package": "withr",
      "Version": "3.0.2",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics"
      ],
      "Hash": "cc2d62c76458d425210d1eb1478b30b4"
    },
    "wordcloud2": {
      "Package": "wordcloud2",
      "Version": "0.2.1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "base64enc",
        "grDevices",
        "graphics",
        "htmlwidgets"
      ],
      "Hash": "10274bd096f5c2ad7471ea0eea0c1424"
    },
    "xfun": {
      "Package": "xfun",
      "Version": "0.49",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "grDevices",
        "stats",
        "tools"
      ],
      "Hash": "8687398773806cfff9401a2feca96298"
    },
    "xml2": {
      "Package": "xml2",
      "Version": "1.3.6",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "cli",
        "methods",
        "rlang"
      ],
      "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61"
    },
    "xmlparsedata": {
      "Package": "xmlparsedata",
      "Version": "1.0.5",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R"
      ],
      "Hash": "45e4bf3c46476896e821fc0a408fb4fc"
    },
    "yaml": {
      "Package": "yaml",
      "Version": "2.3.10",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "51dab85c6c98e50a18d7551e9d49f76c"
    }
  }
}

Restoring renv

If renv is activated but it recognized that the packages listed in the renv.lock file are not installed (or not all of them), renv will suggest to restore the project library using renv::restore():

Output
* This project contains a lockfile, but none of the recorded packages are installed.
* Use `renv::restore()` to restore the project library.
renv::restore()

This will generate a list of files that will be updated.

Click here to view an example output of the renv::restore() command.
The following package(s) will be updated:

# CRAN ===============================
- R6            [* -> 2.5.1]
- base64enc     [* -> 0.1-3]
- bslib         [* -> 0.5.0]
- cachem        [* -> 1.0.8]
- cli           [* -> 3.6.1]
- data.table    [* -> 1.14.8]
- digest        [* -> 0.6.31]
- ellipsis      [* -> 0.3.2]
- evaluate      [* -> 0.21]
- fastmap       [* -> 1.1.1]
- fontawesome   [* -> 0.5.1]
- fs            [* -> 1.6.2]
- glue          [* -> 1.6.2]
- here          [* -> 1.0.1]
- highr         [* -> 0.10]
- htmltools     [* -> 0.5.5]
- jquerylib     [* -> 0.1.4]
- jsonlite      [* -> 1.8.5]
- knitr         [* -> 1.43]
- lifecycle     [* -> 1.0.3]
- magrittr      [* -> 2.0.3]
- memoise       [* -> 2.0.1]
- mime          [* -> 0.12]
- rappdirs      [* -> 0.3.3]
- rlang         [* -> 1.1.1]
- rmarkdown     [* -> 2.22]
- rprojroot     [* -> 2.0.3]
- sass          [* -> 0.4.6]
- stringi       [* -> 1.7.12]
- stringr       [* -> 1.5.0]
- tinytex       [* -> 0.45]
- vctrs         [* -> 0.6.3]
- xfun          [* -> 0.39]
- yaml          [* -> 2.3.7]

Do you want to proceed? [y/N]: 

If you want to proceed with the update, type Y and hit enter.

Installing / removing packages

Install packages:

Code
1install.packages("PACKAGE_NAME")
2renv::install("PACKAGE_NAME")
1
Replace PACKAGE_NAME with the actual name of the package that you want to install.
2
Replace PACKAGE_NAME with the actual name of the package that you want to install.

Remove packages:

Code
1remove.packages("PACKAGE_NAME")
2renv::remove("PACKAGE_NAME")
1
Replace PACKAGE_NAME with the actual name of the package that you want to remove.
2
Replace PACKAGE_NAME with the actual name of the package that you want to remove.

Call renv::snapshot() to save the new state of the project library to the renv.lock:

Code
renv::snapshot()

Commit your changes

The renv.lock is checked into version control, so after you updated it, make a new commit:

Code
git add renv.lock
1git commit -m "Add package PACKAGE_NAME to renv"
1
Replace PACKAGE_NAME with the actual name of the package that you installed. Adapt the commit message as needed.

References

Cite a reference

References are stored in references.bib.

Click here to view the full references.bib file of this project.
references.bib
@article{knuth84,
  author = {Knuth, Donald E.},
  title = {Literate Programming},
  year = {1984},
  issue_date = {May 1984},
  publisher = {Oxford University Press, Inc.},
  address = {USA},
  volume = {27},
  number = {2},
  issn = {0010-4620},
  url = {https://doi.org/10.1093/comjnl/27.2.97},
  doi = {10.1093/comjnl/27.2.97},
  journal = {Comput. J.},
  month = may,
  pages = {97–111},
  numpages = {15}
}

@article{bakker2023,
  author = {Bakker, Arnold B. and Demerouti, Evangelia and Sanz-Vergel, Ana},
  title = {Job Demands-Resources Theory: Ten Years Later},
  issue_date = {January 2023},
  publisher = {Annual Review of Organizational Psychology and Organizational Behavior},
  volume = {10},
  url = {https://doi.org/10.1146/annurev-orgpsych-120920-053933},
  doi = {10.1146/annurev-orgpsych-120920-053933},
  journal = {Annual Review of Organizational Psychology and Organizational Behavior},
  month = jan,
  year = {2023},
  pages = {25-53},
  numpages = {29}
}

@inbook{goodhart1984,
    title = {Problems of Monetary Management: The UK Experience},
    author = {Goodhart, C. A. E.},
    year = {1984},
    date = {1984},
    publisher = {Macmillan Education UK},
    pages = {91--121},
    doi = {10.1007/978-1-349-17295-5_4},
    url = {http://dx.doi.org/10.1007/978-1-349-17295-5_4},
    langid = {en}
}

@article{mckiernan2016,
    title = {How open science helps researchers succeed},
    author = {McKiernan, Erin C and Bourne, Philip E and Brown, C Titus and Buck, Stuart and Kenall, Amye and Lin, Jennifer and McDougall, Damon and Nosek, Brian A and Ram, Karthik and Soderberg, Courtney K and Spies, Jeffrey R and Thaney, Kaitlin and Updegrove, Andrew and Woo, Kara H and Yarkoni, Tal},
    year = {2016},
    month = {07},
    date = {2016-07-07},
    journal = {eLife},
    volume = {5},
    doi = {10.7554/elife.16800},
    url = {http://dx.doi.org/10.7554/eLife.16800},
    langid = {en}
}

@article{abele-brehm2016,
    title = {Wer soll die Professur bekommen?},
    author = {Abele-Brehm, Andrea E. and {Bühner}, Markus},
    year = {2016},
    month = {10},
    date = {2016-10},
    journal = {Psychologische Rundschau},
    pages = {250--261},
    volume = {67},
    number = {4},
    doi = {10.1026/0033-3042/a000335},
    url = {http://dx.doi.org/10.1026/0033-3042/a000335},
    langid = {de}
}

@article{john2012,
    title = {Measuring the Prevalence of Questionable Research Practices With Incentives for Truth Telling},
    author = {John, Leslie K. and Loewenstein, George and Prelec, Drazen},
    year = {2012},
    month = {04},
    date = {2012-04-16},
    journal = {Psychological Science},
    pages = {524--532},
    volume = {23},
    number = {5},
    doi = {10.1177/0956797611430953},
    url = {http://dx.doi.org/10.1177/0956797611430953},
    langid = {en}
}

@article{nosek2022,
    title = {Replicability, Robustness, and Reproducibility in Psychological Science},
    author = {Nosek, Brian A. and Hardwicke, Tom E. and Moshontz, Hannah and Allard, {Aurélien} and Corker, Katherine S. and Dreber, Anna and Fidler, Fiona and Hilgard, Joe and Kline Struhl, Melissa and Nuijten, {Michèle B.} and Rohrer, Julia M. and Romero, Felipe and Scheel, Anne M. and Scherer, Laura D. and {Schönbrodt}, Felix D. and Vazire, Simine},
    year = {2022},
    month = {01},
    date = {2022-01-04},
    journal = {Annual Review of Psychology},
    pages = {719--748},
    volume = {73},
    number = {1},
    doi = {10.1146/annurev-psych-020821-114157},
    url = {http://dx.doi.org/10.1146/annurev-psych-020821-114157},
    langid = {en}
}

@misc{bryan2015,
  author = {Bryan, Jenny},
  title = {How to name files},
  year = {2015},
  month = {May},
  note = {[Online; accessed 19. Nov. 2020]},
  url = {https://speakerdeck.com/jennybc/how-to-name-files}
}

@book{chacon2014,
    title = {Pro Git},
    author = {Chacon, Scott and Straub, Ben},
    year = {2014},
    date = {2014},
    publisher = {Apress},
    doi = {10.1007/978-1-4842-0076-6},
    url = {http://dx.doi.org/10.1007/978-1-4842-0076-6},
    note = {License: CC BY-NC}
}
@article{hanson2019,
    title = {Data Sharing and Management Snafu in 3 Short Acts},
    author = {Hanson, Karen and Surkis, Alisa and Yacobucci, Karen},
    year = {2019},
    date = {2019},
    doi = {10.6084/M9.FIGSHARE.8061722.V1},
    url = {https://figshare.com/articles/Data_Sharing_and_Management_Snafu_in_3_Short_Acts/8061722/1}
}

@book{gau2022,
    title = {Remi-Gau/bids{\_}workshop: v0.1.1},
    author = {Gau, Remi},
    year = {2022},
    month = {10},
    date = {2022-10-09},
    publisher = {Zenodo},
    doi = {10.5281/ZENODO.7178587},
    url = {https://zenodo.org/record/7178587}
}

@article{wilkinson2016,
    title = {The FAIR Guiding Principles for scientific data management and stewardship},
    author = {Wilkinson, Mark D. and Dumontier, Michel and Aalbersberg, IJsbrand Jan and Appleton, Gabrielle and Axton, Myles and Baak, Arie and Blomberg, Niklas and Boiten, Jan-Willem and da Silva Santos, Luiz Bonino and Bourne, Philip E. and Bouwman, Jildau and Brookes, Anthony J. and Clark, Tim and Crosas, {Mercè} and Dillo, Ingrid and Dumon, Olivier and Edmunds, Scott and Evelo, Chris T. and Finkers, Richard and Gonzalez-Beltran, Alejandra and Gray, Alasdair J.G. and Groth, Paul and Goble, Carole and Grethe, Jeffrey S. and Heringa, Jaap and {{\textquoteright}t Hoen}, Peter A.C and Hooft, Rob and Kuhn, Tobias and Kok, Ruben and Kok, Joost and Lusher, Scott J. and Martone, Maryann E. and Mons, Albert and Packer, Abel L. and Persson, Bengt and Rocca-Serra, Philippe and Roos, Marco and van Schaik, Rene and Sansone, Susanna-Assunta and Schultes, Erik and Sengstag, Thierry and Slater, Ted and Strawn, George and Swertz, Morris A. and Thompson, Mark and van der Lei, Johan and van Mulligen, Erik and Velterop, Jan and Waagmeester, Andra and Wittenburg, Peter and Wolstencroft, Katherine and Zhao, Jun and Mons, Barend},
    year = {2016},
    month = {03},
    date = {2016-03-15},
    journal = {Scientific Data},
    volume = {3},
    number = {1},
    doi = {10.1038/sdata.2016.18},
    url = {http://dx.doi.org/10.1038/sdata.2016.18},
    langid = {en}
}

@article{gorgolewski2016,
    title = {The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments},
    author = {Gorgolewski, Krzysztof J. and Auer, Tibor and Calhoun, Vince D. and Craddock, R. Cameron and Das, Samir and Duff, Eugene P. and Flandin, Guillaume and Ghosh, Satrajit S. and Glatard, Tristan and Halchenko, Yaroslav O. and Handwerker, Daniel A. and Hanke, Michael and Keator, David and Li, Xiangrui and Michael, Zachary and Maumet, Camille and Nichols, B. Nolan and Nichols, Thomas E. and Pellman, John and Poline, Jean-Baptiste and Rokem, Ariel and Schaefer, Gunnar and Sochat, Vanessa and Triplett, William and Turner, Jessica A. and Varoquaux, {Gaël} and Poldrack, Russell A.},
    year = {2016},
    month = {06},
    date = {2016-06-21},
    journal = {Scientific Data},
    volume = {3},
    number = {1},
    doi = {10.1038/sdata.2016.44},
    url = {http://dx.doi.org/10.1038/sdata.2016.44},
    langid = {en}
}

@article{broman2018,
  title = {Data Organization in Spreadsheets},
  author = {Karl W. Broman and Kara H. Woo},
  year = {2018},
  month = {04},
  date = {2018-04-24},
  journal = {The American Statistician},
  volume = {72},
  number = {1},
  pages ={2-10},
  doi = {10.1080/00031305.2017.1375989},
  url = {https://doi.org/10.1080/00031305.2017.1375989},
  langid = {en}
}
  
@article{wickham2014,
  title = {Tidy Data},
  author = {Hadley Wickham},
  year = {2014},
  month = {08},
  journal = {Jornal of Statistical Software},
  volume = {59},
  number = {10},
  pages = {1-23},
  doi = {10.18637/jss.v059.i10},
  url = {https://doi.org/10.18637/jss.v059.i10},
  langid = {en}
}
  
@Manual{fischetti2023,
  title = {assertr: Assertive Programming for R Analysis Pipelines},
  author = {Fischetti, Tony},
  year = {2023},
  month = {11},
  date = {2023-11-23},
  note = {R package version 3.0.1https://docs.ropensci.org/assertr/ (website)
https://github.com/ropensci/assertr},
  doi = {10.32614/CRAN.package.assertr},
  url = {https://docs.ropensci.org/assertr/},
}

@article{reinhart2010,
  author = {Reinhart, Carmen M. and Rogoff, Kenneth S.},
  title = {Growth in a Time of Debt},
  journal = {American Economic Review},
  volume = {100},
  number = {2},
  year = {2010},
  month = {May},
  pages = {573–78},
  doi = {10.1257/aer.100.2.573},
  url = {https://www.aeaweb.org/articles?id=10.1257/aer.100.2.573},
}

@article{herndon2014,
  title = {Does high public debt consistently stifle economic growth? A critique of Reinhart and Rogoff},
  author = {Thomas Herndon and Michael Ash and Robert Pollin},
  year = {2014},
  month = {03},
  journal = {Cambridge Journal of Economics},
  volume = {38},
  number = {2},
  pages = {257-279},
  doi = {10.1093/cje/bet075},
  url = {https://doi.org/10.1093/cje/bet075}
}

@article{ziemann2016,
  title = {Gene name erorrs are widespread in the scientific literature},
  author = {Ziemann, M. and Eren, Y. and El-Osta, A.},
  year = {2016},
  month = {08},
  date = {2016-08-23},
  journal = {Genome Biology},
  volume = {17},
  doi = {10.1186/s13059-016-1044-7},
  url = {https://doi.org/10.1186/s13059-016-1044-7}
}

@article{esteban2019,
  title = {fMRIPrep: a robust preprocessing pipeline for functional MRI},
  author = {Oscar Esteban and Christopher J. Markiewicz and Ross W. Blair and Craig A. Moodie and A. Ilkay Isik and Asier Erramuzpe and James D. Kent and Mathias Goncalves and Elizabeth DuPre and Medeleine Snyder and Hiroyuki Oya and Satrajit S. Gish and Jessey Wright and Joke Durnez and Russell A Poldrack and Krzysztof J. Gorgolewski},
  year = {2019},
  month = {01},
  journal = {Nature Methods},
  volume = {16},
  pages = {111-116},
  doi = {10.1038/s41592-018-0235-4},
  url = {https://doi.org/10.1038/s41592-018-0235-4}
}

@book{wittkuhn2024,
  author = {Lennart Wittkuhn and Konrad Pagenstedt},
  title = {Version Control Book},
  publisher = {ZFDM Repository},
  year = {2024},
  month = {02},
  doi = {10.25592/uhhfdm.14149},
  url = {https://doi.org/10.25592/uhhfdm.14149}
}

@article{barker2022,
  author = {Barker, Michelle and Chue Hong, Neil P. and Katz, Daniel S. and Lamprecht, Anna-Lena and Martinez-Ortiz, Carlos and Psomopoulos, Fotis and Harrow, Jennifer and Castro, Leyla Jael and Gruenpeter, Morane and Martinez, Paula Andrea and Honeyman, Tom},
  title = {Introducing the FAIR Principles for research software},
  year = {2022},
  journal = {Scientific Data},
  volume = {9},
  pages = {622},
  doi = {10.1038/s41597-022-01710-x},
  url = {https://doi.org/10.1038/s41597-022-01710-x}
  
}

@book{wickham2023,
    title = {R for Data science: Import, Tidy, Transform, Visualize, and Model Data},
    author = {Wickham, H. and Çetinkaya-Rundel, M. and Grolemund, G.},
    year = {2023},
    data = {2023},
    publisher = {O'Reilly Media},
    url = {https://r4ds.hadley.nz},
    note = {License: CC BY-NC-ND 3.0 US}
}

@Manual{hester2024,
    title = {lintr: A 'Linter' for R Code},
    author = {Jim Hester and Florent Angly and Russ Hyde and Michael Chirico and Kun Ren and Alexander Rosenstock and Indrajeet Patil},
    year = {2024},
    note = {R package version 3.1.2},
    url = {https://CRAN.R-project.org/package=lintr},
}

@Manual{mueller2020,
    title = {here: A Simpler Way to Find Your Files},
    author = {Kirill Müller},
    year = {2020},
    note = {R package version 1.0.1, https://github.com/r-lib/here},
    url = {https://here.r-lib.org/},
  }
  
@misc{rennie2024,
  author       = {Nicola Rennie},
  title        = {Writing Better R Code},
  year         = {2024},
  url          = {https://nrennie.rbind.io/training-better-r-code/},
  note         = {Accessed on 2024-11-19}
}

@article{haslbeck2022,
  author = {Jonas M. Haslbeck and Oisín Ryan and Donald J. Robinaugh and Lourens J. Waldorp and Denny Borsboom},
  title = {Modeling Psychopathology: From Data Models to Formal Theories},
  year = {2022},
  journal = {Psychological Methods},
  volume = {27},
  issue = {6},
  pages = {930-957},
  doi = {10.1037/met0000303},
  url = {https://doi.org/10.1037/met0000303}
}

@Manual{ushey2024,
  title = {renv: Project Environments},
  author = {Kevin Ushey and Hadley Wickham},
  year = {2024},
  note = {R package version 1.0.11, https://github.com/rstudio/renv},
  url = {https://rstudio.github.io/renv/},
}

@misc{rapp2024,
  title = {Robust R Code That Will Work Forever With {renv}},
  url = {https://www.youtube.com/watch?v=Oen9xhEh8PY},
  journal = {YouTube},
  author = {Albert Rapp},
  year = {2024},
  month = {11},
}

@book{community2022,
    title = {The Turing Way: A handbook for reproducible, ethical and collaborative research},
    author = {{The Turing Way Community}},
    year = {2022},
    month = {07},
    date = {2022-07-27},
    publisher = {Zenodo},
    doi = {10.5281/zenodo.3233853},
    url = {https://zenodo.org/record/3233853},
    note = {License: \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 4.0}. Source: \url{https://github.com/the-turing-way/the-turing-way}. Website: \url{https://the-turing-way.netlify.app/}}
}

@misc{wikipedia2025,
  title = {Modularity},
  url = {https://en.wikipedia.org/wiki/Modularity},
  author = {Wikipedia Contributors,},
  year = {2025},
  month = {02},
  day = {10}
}

@article{artner2021,
  title = {The Reproducibility of Statistical Results in Psychological Research: An Investigation Using Unpublished Raw Data},
  author = {Richard Artner and Thomas Verliefde and Sara Steegen and Sara Gomes and Frits Traets and Francis Tuerlinckx and Wolf Vanpaemel},
  year = {2021},
  journal = {Psychological Methods},
  volume = {26},
  issue = {5},
  pages = {527-546},
  doi = {10.1037/met0000365},
  url = {https://doi.org/10.1037/met0000365}
}

@article{crüwell2023,
  title = {What’s in a Badge? A Computational Reproducibility Investigation of the Open Data Badge Policy in One Issue of Psychological Science},
  author = {Sophia Crüwell and Deborah Apthorp and Bradley J. Baker and Lincoln Colling and Malte Elson and Sandra J. Geiger and Sebastian Lobentanzer and Jean Monéger and Alex Patterson and D. Samuel Schwarzkopf and Mirela Zaneva and Nicholas J. L. Brown},
  year = {2023},
  journal = {Psychological Science},
  volume = {34},
  issue = {4},
  pages = {513-522},
  doi = {10.1177/09567976221140828},
  url = {https://doi.org/10.1177/09567976221140828}
}

@article{hardwicke2021,
  title = {Analytic reproducibility in articles receiving open data badges at the Journal *Psychological Science*: an observational study},
  author = {Tom E. Hardwicke and Manuel Bohn and Kyle MacDonald and Emily Hembacher and Michéle B. Nuijten and Benjamin N. Peloquin and Benjamin E. deMayo and Bria Long and Erica J. Yoon and Michael C. Frank},
  year = {2021},
  journal = {Royal Society Open Science},
  volume = {8},
  pages = {201494},
  doi = {10.1098/rsos.201494},
  url = {https://doi.org/10.1098/rsos.201494}
}

@article{obels2020,
  title = {Analysis of Open Data and Computational Reproducibility in Registered Reports in Psychology},
  author = {Pepijn Obels and Daniël Lakens and Nicholas A. Coles and Jaroslav Gottfried and Seth A. Green},
  year = {2020},
  journal = {Advances in Methods and Practices in Psychological Science},
  volume = {3},
  issue = {2},
  pages = {229-237},
  doi = {10.1177/2515245920918872},
  url = {https://doi.org/10.1177/2515245920918872}
}

@article{lakomy2019,
  title = {Open Science and the Science-Society Relationship},
  author = {Martin Lakomý and Renata Hlavová and Hana Machackova},
  year = {2019},
  journal = {Society},
  volume = {56},
  pages = {246-255},
  doi = {10.1007/s12115-019-00361-w},
  url = {https://doi.org/10.1007/s12115-019-00361-w}
}

@book {cribb2010,
    author = {Julian Cribb and Tjempaka Sari},
    title = {Open Science: Sharing Knowledge in the Global Century},
    pages = {230},
    year = {2010},
    doi = {10.1071/9780643097643},
    publisher = {CSIRO Publishing},
    isbn = {978-0-643-10183-8},
    URL = {https://doi.org/10.1071/9780643097643}
}

@article{opensciencecollaboration2015,
  title = {Estimating the reproducibility of psychological science},
  author = {Open Science Collaboration,},
  year = {2015},
  month = {august},
  date = {2015-08-28},
  journal = {Science},
  volume = {349},
  pages = {aac4716},
  doi = {10.1126/science.aac4716},
  url = {https://doi.org/10.1126/science.aac4716}
}

@article{begley2012,
  title = {Raise standards for preclinical cancer research},
  author = {C. Glenn Begley and Lee M. Ellis},
  year = {2012},
  journal = {nature},
  volume = {483},
  pages = {531-533},
  doi = {10.1038/483531a},
  url = {https://doi.org/10.1038/483531a}
}

@article{stroop1935,
  title = {Studies of interference in serial verbal reactions},
  author = {Stroop, J. R.},
  year = {1935},
  journal = {Journal of Experimental Psychology},
  volume = {18},
  issue = {6},
  pages = {643-662},
  doi = {10.1037/h0054651},
  url = {https://doi.org/10.1037/h0054651}
}

@article{williams1996,
  title = {The emotional Stroop task and psychopathology},
  author = {Williams, J. M. G. and Mathews, A. and MacLeod, C.},
  year = {1996},
  journal = {Psychological Bulletin},
  volume = {120},
  issue = {1},
  pages = {3-24},
  doi = {10.1037/0033-2909.120.1.3},
  url = {https://doi.org/10.1037/0033-2909.120.1.3}
}

@article{poldrack2019,
title = {The Costs of Reproducibility},
journal = {Neuron},
volume = {101},
number = {1},
pages = {11-14},
year = {2019},
issn = {0896-6273},
doi = {https://doi.org/10.1016/j.neuron.2018.11.030},
url = {https://www.sciencedirect.com/science/article/pii/S0896627318310390},
author = {Russell A. Poldrack},
abstract = {Improving the reproducibility of neuroscience research is of great concern, especially to early-career researchers (ECRs). Here I outline the potential costs for ECRs in adopting practices to improve reproducibility. I highlight the ways in which ECRs can achieve their career goals while doing better science and the need for established researchers to support them in these efforts.}
}

@misc{yarkoni2018,
  title = {No, it’s not The Incentives — it’s you},
  author = {Tal Yarkoni},
  url = {https://talyarkoni.org/blog/2018/10/02/no-its-not-the-incentives-its-you/},
  year = {2018},
  month = {October},
  day = {2},
  note = {Accessed: 2025-04-04}
}

Use the citation handle of the .bib-entry that you want to cite. For example use @chacon2014 to cite Chacon and Straub (2014). For details, see the chapter on “Citations & Footnotes” in the Quarto documentation. Add the specific references that you used to the bottom of the document. If the reference consists of multiple chapters and pages, try to specify the exact chapter or page.

Add a new reference

  1. Open references.qmd.
  2. Switch to the Visual Quarto editor.
  3. Move the cursor into any place in the document.
  4. Click on Insert and select @ Citation ....
  5. If the reference has a DOI:
    1. Select From DOI.
    2. Paste the DOI.
    3. Select Insert.
  6. This should add the new reference to references.bib.
  7. Move the citation key to the correct place in the document.

Add license information

We want to keep track of license information. If you add a new reference, please add the license information manually.

  1. Go to references.bib and find the reference.
  2. Inside the .bib-entry for the reference add a new field called note that includes the license information.
@book{
  note = {License: CC BY-NC}
}

For example, this is the references for Chacon and Straub (2014):

@book{chacon2014,
    title = {Pro Git},
    author = {Chacon, Scott and Straub, Ben},
    year = {2014},
    date = {2014},
    publisher = {Apress},
    doi = {10.1007/978-1-4842-0076-6},
    url = {http://dx.doi.org/10.1007/978-1-4842-0076-6},
    note = {License: CC BY-NC}
}

Code

Add code snippets

Add code snippets to a Quarto document like this:

```{zsh}
echo "Hello World!"
```
Disable code execution in all Quarto documents by default!

Place the following code in the YAML header of each Quarto document:

Code
engine: knitr
execute:
  eval: false
Example: Click here for the YAML header of the current document.
contributing.qmd
---
engine: knitr
execute: 
  eval: false
---
Click here to learn more.

Quarto enables the inclusion of executable code blocks in Markdown. This empowers users to create reproducible documents and reports, as the code needed for generating the output is embedded within the document and automatically executed during rendering.

However, in this guide, we usually only want to display code but not execute it! We therefore need to disable code execution in the YAML header of each Quarto document.

The YAML header in a Quarto document is used to specify important metadata and settings for the document. It is typically placed at the top of the document enclosed between three dashes (---) to separate it from the main content. The YAML header provides instructions to the Quarto rendering engine on how to process and present the document.

Reference external code

You can reference external code. For example, the following code block will:

description code
1 reference the _quarto.yml file #&#124; file: _quarto.yml
2 display the first five lines of code echo=c(1:5)
3 add code line numbers #&#124; code-line-numbers: true
4 add a filename to the code block filename="_quarto.yml"
```{bash, filename="_quarto.yml", echo=c(1:5)}
#| file: _quarto.yml
#| code-line-numbers: true
```
Click here for the output of this example.
_quarto.yml
project:
  type: book
  execute-dir: project
  output-dir: _book
  preview: 

Add code annotations

Code blocks and executable code cells in Quarto can include line-based annotations. Line-based annotations provide a way to attach explanation to lines of code much like footnotes.

For example, this is a code annotation for the git status command:

```{zsh}
git status
```
1. `git status` displays the state of the working directory and the staging area.

Images

Background

Images are stored in a NextCloud folder. They are downloaded into the /images folder using the command specified in the Makefile.

Installation

You need to install the following packages:

  1. GNU Make

GNU Make should already be installed. Try by entering the following command into the Terminal:

Code
make --version

Find instructions to install make on Windows here.

TBA

Retrieve images

After you installed all the required software, run this command:

make images
Makefile
IMAGES_URL=https://cloud.uni-hamburg.de/s/pzEHT5DF3PzFdLH/download
IMAGES_ARCHIVE=repro-book-images.zip
IMAGES_DIR=images/

all: render

.PHONY: preview
preview:
    quarto preview

.PHONY: render
render: clean images
    quarto render

.PHONY: pdf
pdf: clean images
    quarto render --profile pdf
    
.PHONY: deploy
deploy: clean images
    quarto publish gh-pages

.PHONY: images
images:
    curl $(IMAGES_URL) -o $(IMAGES_ARCHIVE)
    unzip -j -o $(IMAGES_ARCHIVE) -d $(IMAGES_DIR)
    rm -f $(IMAGES_ARCHIVE)

.PHONY: clean
clean:
    rm -rf $(IMAGES_DIR)* _book/

Add a new image

  1. Become a collaborator on the UHH Cloud folder.
  2. Go to the UHH Cloud folder.
  3. Place the new image inside the folder. Please use - to separate words in the filename.
  4. Reference the image in the Quarto document relative to the root of the project directory:
![](static/NEW-IMAGE.png)

Download images in pre-render command

It’s also possible to include the make static as a project script in the pre-render script. This would re-execute make static before every render. For the moment, we disabled this option, but it can be enabled in _quarto.yml.

Variables

Quarto offers a number of ways to include dynamic variables within documents. Dynamic variables are useful for externalizing content that varies depending on context, or as an alternative to repeating a value in multiple places.

Creating a variable

In this project, we use a project-level _variables.yml file to define variables. Variables can be either simple values or can include arbitrary Markdown content.

_variables.yml (excerpt)
  name: "repro-book"
  title: "The Repro Book"
Click here to view the full _variables.yml file of this project.
_variables.yml
project:
  name: "repro-book"
  title: "The Repro Book"
  subtitle: "A Guide to Reproducible Research"
  description: "The Repro Book - A Guide to Reproducible Research"
  email: "lennart.wittkuhn@uni-hamburg.de"
  mailto: "mailto:{{< var project.email >}}"
  site-url: "https://lennartwittkuhn.com/repro-book"
  repo-host: "GitHub"
  repo-url: "https://github.com/lnnrtwttkhn/repro-book"
  issue-url: "{{< var project.repo-url >}}/issues"
  new-issue-url: "{{< var project.repo-url >}}/issues/new"
  contributors-url: "{{< var project.repo-url >}}?tab=readme-ov-file#contributors"
  images-url: "https://cloud.uni-hamburg.de/s/pzEHT5DF3PzFdLH"
  license-long: "Creative Commons Attribution 4.0 International ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/))"
  license-short: "[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)"
  license-badge: "[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)"
  duration: "2024 -- 2025"
  website-badge: "[![Website](https://img.shields.io/website?url=https%3A%2F%2Flennartwittkuhn.com%2Frepro-book%2F)]({{< var project.site-url >}})"
  codespell-badge: "[![Codespell]({{< var project.repo-url >}}/actions/workflows/codespell.yml/badge.svg)]({{< var project.repo-url >}}/actions/workflows/codespell.yml)"
  all-contributors-badge: "[![All Contributors](https://img.shields.io/github/all-contributors/projectOwner/projectName?color=ee8449&style=flat-square)]({{< var project.contributors-url >}})"
  rproj: "repro-book.Rproj"
  readme: "https://github.com/lnnrtwttkhn/repro-book/blob/main/README.md"
links:
  uhh: "https://www.uni-hamburg.de/en.html"
  uhh-ddlitlab: "https://www.isa.uni-hamburg.de/en/ddlitlab.html"
  uhh-isa: "https://www.isa.uni-hamburg.de/"
  stiftung-hochschullehre: "https://stiftung-hochschullehre.de/en/"
  funding-info: "https://stiftung-hochschullehre.de/projekt/ddlitlab/"
  plausible: "https://plausible.io/"
  quarto: "https://quarto.org/"
  markdown: "https://www.markdownguide.org/"
  bids: "https://bids.neuroimaging.io"
  psych-ds: "https://psych-ds.github.io"
  git: "https://git-scm.com/"
  github: "https://github.com/"
  version-control-book: "https://lennartwittkuhn.com/version-control-book/"
  gnu-make-windows: "https://leangaurav.medium.com/how-to-setup-install-gnu-make-on-windows-324480f1da69"
  mpib: "https://www.mpib-berlin.mpg.de/en"
  issues: "https://github.com/lnnrtwttkhn/repro-book/issues"

Using a variable

The var shortcode then allows to include references to those variables within any document in this project. For example, to include the link to the Nextcloud folder that stores static contents (images etc.) as a variable in a document, use:

Code
{{< var project.images-url >}}

This will inject the contents of the variable into the document. In this example, {{< var project.images-url >}} will be displayed as https://cloud.uni-hamburg.de/s/pzEHT5DF3PzFdLH.

For more details on variables, read the chapter on Variables in the Quarto documentation.

Fontawesome Icons

We use the Font Awesome Extension for Quarto to include Font Awesome icons.

This extension provides support including free icons provided by Font Awesome. Icons can be used in both HTML (via Font Awesome 6 Free) and PDF (via the fontawesome5 LaTeX package).

This extension includes support for only free Font Awesome icons.

To embed an icon, use the {{< fa >}} shortcode. For example, {{< fa thumbs-up >}} will result in . For details, see the project documentation on GitHub.

Style Guide

We have compiled a set of guidelines to keep a consistent style across all chapters of the book.

Summary

  1. Write one sentence per line
  2. Use consistent language

Write one sentence per line

Please write each sentence on a new line. Having each sentence on a new line will make no difference to how the text is displayed, there will still be paragraphs, but it will mean that any pull requests will be easier to check; the changes will be on a single line instead of somewhere in a paragraph. Consider the example below.

Today you are you, that is truer than true. There is no one alive who is youer than you. - Dr Seuss

A pull request on this correcting it to have a ‘.’ after Dr would show as a change to the whole paragraph. Contrast this with the next example which will be displayed online in the exact same way, but would see a change to a single line.

Today you are you, that is truer than true.
There is no one alive who is youer than you.
- Dr Seuss

Acknowledgements & Attribution