Skip to contents

This package is not intended for broad public use. Its main purpose is to:

  1. provide transparent documentation of the data analyses forming the backbone of the empirical part of Mana et al. (under review), and

  2. supply the set of functions used to generate those results, which can be reused or adapted for projects with similar objectives.

Installation

To install a local instance of the package, run:

# If you do not have the devtools package,
# install it by uncommenting the following line:
#install.packages(devtools)
devtools::install_github("josefmana/demcrit")

Reproducibility

To ensure full reproducibility of the results, it is important to use the same package versions that were originally used to generate them in the first place. The demcrit package manages its package dependencies throug renv.

If full reproducibility is your goal, before proceeding, please run the following code to restore the package environment exactly as used in the original analysis:

# If you do not have the renv package,
# install it by uncommenting the following line:
#install.packages("renv", version = "1.1.4")
renv::restore()

How to Use

There are two main ways to work with the package (each described in its own vignette):

  1. With raw data available – Place the raw data files in the data-raw folder and run the included targets pipeline. See the vignette “Targets Pipeline” for details.

  2. Without raw data – You can still use many of the package functions with your own, similarly structured dataset. See the vignette “Out of Pipeline” for guidance.

Future Directions

Currently, demcrit is designed around the dataset used in our original study. As such, it primarily supports direct replications rather than general applications.

If you find the approach useful and would like to adapt it for your data, feel free to reach out — we are happy to discuss possible extensions. We also welcome reports of bugs or mistakes you may encounter.