Skip to content

Commit

Permalink
updated ic_tbl documentation, WIP #60
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Dec 7, 2023
1 parent e9ea83f commit d56e966
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 10 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ get_epidist_param <- function(epidist,
return(unname(params[idx]))
}

#' Helper function to create model comparison table
#' Helper function to create a model comparison table
#'
#' @description This is a helper function for creating a model comparison
#' `<data.frame>` primarily for use in the \pkg{superspreading} vignettes. It
Expand All @@ -47,7 +47,9 @@ get_epidist_param <- function(epidist,
#' function to create information criteria tables.
#'
#' @param ... [dots] One or more model fit results from
#' [fitdistrplus::fitdist()]
#' [fitdistrplus::fitdist()].
#' @param sort_by A `character` string specifying which information criterion
#' to order the table by, either `"AIC"` (default) or `"BIC"`.
#'
#' @return A `<data.frame>`.
#' @export
Expand All @@ -59,7 +61,12 @@ ic_tbl <- function(..., sort_by = c("AIC", "BIC")) {
# input checking
stopifnot(
"Input objects must be <fitdist>" =
vapply(models, checkmate::test_class, FUN.VALUE = logical(1), classes = "fitdist")
vapply(
models,
checkmate::test_class,
FUN.VALUE = logical(1),
classes = "fitdist"
)
)

distribution <- vapply(models, "[[", FUN.VALUE = character(1), "distname")
Expand Down
7 changes: 5 additions & 2 deletions man/ic_tbl.Rd

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

0 comments on commit d56e966

Please sign in to comment.