#' Output hypotheses
#'
#' Output hypotheses specified in the json file
#'
#' @param study A study list object created with pipeline()
#' @return The study object
output_hypotheses <- function(study) {
cat("## Hypotheses\n\n")
for (i in 1:length(study$hypotheses)) {
cat("### Hypothesis ", i, "\n\n", study$hypotheses[[i]]$desc, "\n\n", sep = "")
criteria <- study$hypotheses[[i]]$criteria
for (j in 1:length(criteria)) {
cat("* Criterion", j, "is confirmed if analysis",
criteria[[j]]$test, "yields",
criteria[[j]]$result,
criteria[[j]]$direction,
criteria[[j]]$comparator,
" \n"
)
}
cat("\n")
# explain evaluation
eval <- study$hypotheses[[i]]$evaluation
if (eval %in% c("&", "and")) {
cat("If all criteria are met, this hypothesis is supported.")
} else if (eval %in% c("|", "or")) {
cat("If any criteria are met, this hypothesis is supported.")
} else {
cat(eval)
}
cat("\n\n\n")
}
invisible(study)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.