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

Clean probability distribution name internal to resolve case sensitive matching issue #376

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

joshwlambert
Copy link
Member

This PR addresses #375 by cleaning the probability distribution name internally. This resolves an issue whereby the resulting <epiparameter> would be unparameterised due to not matching the string to construct the distribution object to be stored in the <epiparameter> object.

The fix applied in this PR now means the prob_distribution argument is now insensitive to case and whitespace, e.g.

library(epiparameter)
epiparameter::epiparameter(
  disease = "Mpox", 
  epi_dist = "serial interval", 
  prob_distribution = " WeiBull  ", 
  prob_distribution_params = c(shape = 2, scale = 2), 
  citation = create_citation(
    author = "James Smith", 
    year = 2000, 
    title = "Mpox stuff", 
    journal = "Journal of Epi", 
    doi = "10.2812ha"
  )
)
#> Using Smith J (2000). "Mpox stuff." _Journal of Epi_. doi:10.2812ha
#> <https://doi.org/10.2812ha>. 
#> To retrieve the citation use the 'get_citation' function
#> Disease: Mpox
#> Pathogen: NA
#> Epi Distribution: serial interval
#> Study: Smith J (2000). "Mpox stuff." _Journal of Epi_. doi:10.2812ha
#> <https://doi.org/10.2812ha>.
#> Distribution: weibull
#> Parameters:
#>   shape: 2.000
#>   scale: 2.000

Created on 2024-09-13 with reprex v2.1.0

@joshwlambert joshwlambert merged commit b6ae203 into main Sep 13, 2024
7 checks passed
@joshwlambert joshwlambert deleted the prob-dist-name branch September 13, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant