
Create <epiparameter> object(s) directly from the epiparameter library (database)
Source: R/epiparameter_db.R
epidist_db.Rdepidist_db() has been renamed epiparameter_db(). Please use
epiparameter_db() instead as the epidist_db() alias will be removed from
the package in the future.
Usage
epidist_db(
disease = "all",
pathogen = "all",
epi_name = "all",
author = NULL,
subset = NULL,
single_epiparameter = FALSE
)Arguments
- disease
A
characterstring specifying the disease.- pathogen
A
characterstring specifying the pathogen.- epi_name
A
characterstring specifying the epidemiological parameter. See details for full list of epidemiological distributions.A
characterstring specifying the author of the study reporting the distribution. Only the first author will be matched. It is recommended to use the family name as first names may or may not be initialised.- subset
Either
NULLor a valid R expressions that evaluates to logicals to subset the list of<epiparameter>, or a function that can be applied over a list of<epiparameter>objects.Subsetting (using
subset) can be combined with the subsetting done with thediseaseandepi_namearguments (andauthorif specified). If left asNULL(default) no subsetting is carried out.The
subsetargument is similar to subsetting a<data.frame>, but the difference is that fixed comparisons and not vectorised comparisons are needed. For examplesample_size > 10is a valid subset expression, butsample_size == max(sample_size), which would be a valid subset expression for a<data.frame>does not work. The vectorised expression will often not error, but will likely return unexpected results. For thesample_size == max(sample_size)example it will always returnTRUE(except forNAs) as it is a single numeric so will be equal to it's max value.The expression should be specified without using the data object name (e.g.
df$var) and instead justvarshould be supplied. In other words, this argument uses non-standard evaluation, just as thesubsetargument insubset(), and is similar to<data-masking>used by thedplyrpackage.- single_epiparameter
A boolean
logicaldetermining whether a single<epiparameter>or multiple entries from the library can be returned if matched by the other arguments (disease,epi_name,author). This argument is used to prevent multiple sets of parameters being returned when only one is wanted.Note: If multiple entries match the arguments supplied and
single_epiparameter = TRUEthen the<epiparameter>that is parameterised (and accounts for truncation if available) and has the largest sample size will be returned (seeis_parameterised()). If multiple entries are equal after this sorting the first entry will be returned.