giabaio / BCEA

Bayesian Cost Effectiveness Analysis. Given the results of a Bayesian model (possibly based on MCMC) in the form of simulations from the posterior distributions of suitable variables of costs and clinical benefits for two or more interventions, produces a health economic evaluation. Compares one of the interventions (the "reference") to the others ("comparators"). Produces many summary and plots to analyse the results
https://gianluca.statistica.it/software/bcea/
GNU General Public License v3.0
40 stars 16 forks source link

make.report(...) function expects an Rmd file in /report.Rmd location? #43

Closed jSoboil closed 1 year ago

jSoboil commented 1 year ago

R returns the following error when trying to knit an automated report using BCEA:

Error in abs_path(input) : The file '/report.Rmd' does not exist.

giabaio commented 1 year ago

Can you elaborate, possibly with a reproducible example? I'll look into it then!

Thanks for this! G

jSoboil commented 1 year ago

Hey Gianluca,

It initially produced the error with a real-life model, but after running a simple script it reproduces it using simulated values. See below:

# Set seed:
set.seed(13412)

# Load libraries
library(BCEA)

# Randomly sample effects and cost data:
eff <- matrix(data = (rnorm(n = 2 * 100)), nrow = 100, ncol = 2)
cost <- matrix(data = (rlnorm(n = 2 * 100, meanlog = 5)), nrow = 100, ncol = 2)

# Create BCEA object
df_cea <- bcea(eff = eff, cost = cost, ref = 1, .comparison = 2)

# Call make.report() function:
BCEA::make.report(bcea(eff = eff, cost = cost, ref = 1, .comparison = 2)) # calling bcea function directly
BCEA::make.report(df_cea) # calling bcea object

The last two lines of code return:

Error in abs_path(input) : The file '/report.Rmd' does not exist.
giabaio commented 1 year ago

Hi @jSoboil, Sorry for being a bit slow. I think this is sorted. If you install the current `dev' version, with

remotes::install_github("giabaio/BCEA",ref="dev")

all should be back to working OK.

Please do shout if there's still something not quite right!

jSoboil commented 1 year ago

Thanks, Gianluca! Not slow at all...