-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
* Move fitting functions into fit * Create stancode.R * Create validate.R * Remove defaults.R and generics.R and pkgdown groups * Document * Don't need this line * Standardise providing ... argument to generics * Remove whitespace * Fix R CMD CHECK warning * Return NULL by default for stancode * Add test of Stan code NULL case * Add test for stanvars class
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' Define model specific Stan code | ||
#' | ||
#' This function is used within [epidist()] to create any custom Stan code which | ||
#' is injected into `brms` via the `stanvars` argument. It is unlikely that | ||
#' as a user you will need this function, but we export it nonetheless to be | ||
#' transparent about what exactly is happening inside of a call to [epidist()]. | ||
#' | ||
#' @inheritParams epidist_validate | ||
#' @param ... Additional arguments passed to method. | ||
#' @rdname epidist_stancode | ||
#' @family stan | ||
#' @export | ||
epidist_stancode <- function(data, ...) { | ||
UseMethod("epidist_stancode") | ||
} | ||
|
||
#' Default method for defining model specific Stan code | ||
#' | ||
#' @inheritParams epidist_stancode | ||
#' @param ... Additional arguments passed to method. | ||
#' @family stan | ||
#' @export | ||
epidist_stancode.default <- function(data, ...) { | ||
return(NULL) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#' Validate a data object for use with [epidist()] | ||
#' | ||
#' This function validates that the provided `data` is suitable to run a | ||
#' particular `epidist` model. This may include checking the class of `data`, | ||
#' and that it contains suitable columns. | ||
#' | ||
#' @param data A `data.frame` containing line list data. | ||
#' @param ... Additional arguments passed to method. | ||
#' @family validate | ||
#' @export | ||
epidist_validate <- function(data, ...) { | ||
UseMethod("epidist_validate") | ||
} | ||
|
||
#' Default method for data validation | ||
#' | ||
#' @inheritParams epidist_validate | ||
#' @param ... Additional arguments passed to method. | ||
#' @family validate | ||
#' @export | ||
epidist_validate.default <- function(data, ...) { | ||
cli_abort( | ||
"No epidist_validate method implemented for the class ", class(data), "\n", | ||
"See methods(epidist_validate) for available methods" | ||
) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.