reproduce_analysis: Reproduce the Analysis for Longitudinal Illusory Truth Study

Description Usage Arguments Details Value See Also Examples

View source: R/reproduce.R

Description

Re-run the analysis for the \insertCiteHenderson_Simons_Barr_2021;textualtruthiness longitudinal truth study.

Usage

1
2
3
4
5
6
7
8
reproduce_analysis(
  outfile = "analysis.html",
  refit = FALSE,
  savefig = FALSE,
  recipe = FALSE,
  parallel = TRUE,
  infile = NULL
)

Arguments

outfile

Path to the HTML output file.

refit

Whether to re-fit the cumulative link mixed model TRUE or to use the built-in model fits (FALSE). Due to the extremely time-consuming nature of model estimation, the default is set to FALSE.

savefig

Whether to save the two plots as separate PNG files (means_plot.png and validation_plot.png).

recipe

Include instructions on how to reproduce the analysis.

parallel

Whether to fit models using a single CPU processing core (FALSE) or multiple cores (TRUE, the default). If refit is FALSE, this parameter is ignored.

infile

Path to the R Markdown script; NULL to use the built-in script.

Details

Runs R Markdown script containing the analysis code. The analysis is performed on the built-in preprocessed anonymized data (documented in truth_trajectory_data). The script output is rendered as an HTML report, specified by outfile. Although it is not necessary to do so, the master R Markdown script for processing real data can be accessed using

rmarkdown::draft("analysis.Rmd", "illusory-truth-analysis", "truthiness")

Value

A string with the path to the generated HTML report.

Path to the rendered HTML report.

See Also

reproduce_analysis_sim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tf <- tempfile(fileext = ".html")

## Run the built-in R Markdown script without refitting models.
## To re-fit the models, set refit = TRUE
## (NB: refitting can take ~ 24 hours)
reproduce_analysis(tf)

browseURL(tf)

## clean up
if (file.exists(tf)) file.remove(tf)

truthiness documentation built on May 24, 2021, 9:07 a.m.