Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error flagged with as_epidist for epireview object #306

Open
3 of 4 tasks
adamkucharski opened this issue May 16, 2024 · 2 comments
Open
3 of 4 tasks

Error flagged with as_epidist for epireview object #306

adamkucharski opened this issue May 16, 2024 · 2 comments
Milestone

Comments

@adamkucharski
Copy link
Member

Please place an "x" in all the boxes that apply

  • I have the most recent version of this package and R
  • I have found a bug
  • I have a reproducible example
  • I want to request a new feature

The below call to as_epidist with a Lassa gamma distributed parameter is returning the following error:
Error in is_epidist_params(prob_dist, prob_dist_params) : Assertion on 'prob_dist_params' failed: Must have unique names, but element 3 is duplicated.

lassa_data <- epireview::load_epidata("lassa")
lassa_params <- lassa_data$params
pick_gamma <- lassa_params[261,]
param1 <- as_epidist(pick_gamma)

@adamkucharski
Copy link
Member Author

Also found an error with Ebola parameter with exponential distribution:

# Load Ebola data
data_in <- load_epidata(pathogen = "ebola")

# Extract parameters for onset to death, with qualtiy score > 50
params_in <- data_in[["params"]] 
params_infectious <- params_in |> dplyr::filter(parameter_type=="Human delay - infectious period") 

# Select distribution
params_inf_with_dist <- params_infectious |> dplyr::filter(!is.na(distribution_type))

# Start by extracting only those with Exponential
as_epidist(params_inf_with_dist)

@jfunction
Copy link

Looks like when

epidist <- epireview_to_epidist(x, ...)
gets called, eventually new_epidist gets called and
mean = summary_stats$mean
makes a new vector with 3 elements. Ie, a vector is created where mean is represented twice.

@joshwlambert joshwlambert added this to the v0.2.0 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants