Description Usage Arguments Details Examples
Runs the main analysis for \insertCiteHenderson_Simons_Barr_2021;textualtruthiness on simulated data.
1 2 3 4 5 6 7 | reproduce_analysis_sim(
path,
outfile = "analysis.html",
recipe = FALSE,
parallel = TRUE,
infile = NULL
)
|
path |
Path to a subdirectory containing the preprocessed
anonymized (simulated) data files (see
|
outfile |
Path to the HTML output file. |
recipe |
Include instructions on how to reproduce the analysis. |
parallel |
Whether to fit models using a single CPU processing
core ( |
infile |
Path to the R Markdown script; |
Runs R Markdown script on the data in the provided
subdirectory and renders the HTML report to outfile
. The
master R Markdown script can be accessed using:
rmarkdown::draft("analysis.Rmd",
"illusory-truth-analysis-sim", "truthiness")
Note that this script can take *very* long to run, depending on the size of the simulated dataset, the number of processing cores, and the computational power of the hardware.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | td_raw <- tempfile() # temp dir for raw data
td_anon <- tempfile() # temp dir for preprocessed data
## simulate data and preprocess it
set.seed(62)
simulate_resp_files(32, path = td_raw, overwrite = TRUE)
## temporary files
tf1 <- tempfile(fileext = ".html")
tf2 <- tempfile(fileext = ".html")
## run the built-in R Markdown preprocessing script
pp_report <- preprocess_simulated(path = td_raw, outpath = td_anon,
report = tf1)
## run the built-in R Markdown analysis script
## this can take very long due to the CLMM fits
a_report <- reproduce_analysis_sim(path = td_anon,
outfile = tf2,
parallel = FALSE)
browseURL(a_report)
## clean up
file.remove(pp_report)
file.remove(a_report)
## clean up
unlink(td_raw, TRUE, TRUE)
unlink(td_anon, TRUE, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.