make_report: Make Report

View source: R/make_report.R

make_reportR Documentation

Make Report

Description

Constructs the automated report from the output of the NMA.

Usage

make_report(nma_model, ext = "pdf", echo = FALSE, ...)

Arguments

ext

A string of text to indicate the extension of the resulting output file. Possible options are "pdf", "docx". This requires the use of pandoc, knitr and rmarkdown.

echo

A string (default to FALSE) to instruct whether the report should also include the BCEA commands used to produce the analyses. If the optional argument echo is set to TRUE (default = FALSE), then the commands are also printed.

...

Additional parameters.

Examples


## Not run: 
bugs_params <-
list(
  PROG = "openBugs",  # which version of BUGS to use to run the MCMC
  N.BURNIN = 10,#00,  # number of steps to throw away
  N.SIMS = 150,#0,    # total number of simulations
  N.CHAINS = 2,       # number of chains
  N.THIN = 1,         # thinning rate
  PAUSE = TRUE)

RANDOM <- FALSE             # is this a random effects model?
REFTX <- "X"                # reference treatment
data_type <- c("hr_data", "surv_bin_data", "med_data") # which type of data to use
label_name <- "label_name"

file_name <- here::here(file.path("inst", "extdata", "survdata_"))

survDataHR <-
  read.csv(paste0(file_name, "hr_test.csv"),
           header = TRUE,
           as.is = TRUE)

survDataBin <-
  tryCatch(
    read.csv(paste0(file_name, "bin_test.csv"),
             header = TRUE,
             as.is = TRUE),
    error = function(e) NA)

survDataMed <-
  tryCatch(
    read.csv(paste0(file_name, "med_test.csv"),
             header = TRUE,
             as.is = TRUE) %>% 
      mutate(medR = floor(medR)),
    error = function(e) NA)

nma_model <-
  new_NMA(survDataHR = survDataHR,
          survDataMed = survDataMed,
          survDataBin = survDataBin,
          bugs_params = bugs_params,
          is_random = RANDOM,
          data_type = data_type,
          refTx = REFTX ,
          effectParam = "beta",
          label = "",
          endpoint = "")

nma_model

make_report(nma_model, ext = "docx")



## End(Not run)


ICON-in-R/NMA documentation built on Nov. 14, 2023, 10:54 a.m.