Skip to content

Commit

Permalink
add ... to epidist and new_epidist
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Jun 10, 2024
1 parent 9e1a5f7 commit 48d531e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
18 changes: 14 additions & 4 deletions R/epidist.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ new_epidist <- function(disease = character(),
method_assess = list(),
discretise = logical(),
truncation = numeric(),
notes = character()) {
notes = character(),
...) {
# check ci has been given for each param and param and uncertainty names match
stopifnot(
"uncertainty must be provided for each parameter" =
Expand Down Expand Up @@ -93,7 +94,8 @@ new_epidist <- function(disease = character(),
prob_dist = prob_dist,
prob_dist_params = prob_dist_params,
discretise = discretise,
truncation = truncation
truncation = truncation,
...
)
}

Expand Down Expand Up @@ -205,6 +207,12 @@ new_epidist <- function(disease = character(),
#' distribution was truncated, `NA` if not or unknown.
#' @param notes A `character` string with any additional information about the
#' data, inference method or disease.
#' @param ... [dots] Extra arguments to be passed to internal functions.
#'
#' This is most commonly used to pass arguments to [distcrete::distcrete()]
#' that construct the discretised distribution S3 object. To see which
#' arguments can be adjusted for discretised distributions see
#' [distcrete::distcrete()].
#'
#' @return An `<epidist>` object.
#' @export
Expand Down Expand Up @@ -272,7 +280,8 @@ epidist <- function(disease,
method_assess = create_epidist_method_assess(),
discretise = FALSE,
truncation = NA_real_,
notes = NULL) {
notes = NULL,
...) {
# check input
checkmate::assert_string(disease)
checkmate::assert_character(pathogen)
Expand Down Expand Up @@ -323,7 +332,8 @@ epidist <- function(disease,
method_assess = method_assess,
discretise = discretise,
truncation = truncation,
notes = notes
notes = notes,
...
)

# call epidist validator
Expand Down
10 changes: 9 additions & 1 deletion man/epidist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion man/new_epidist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48d531e

Please sign in to comment.