R/get_n_infections.R

Defines functions get_n_infections

Documented in get_n_infections

##' Calculate Number of Infections
##'
##' Calculates number of potential infections detected from testing + surveillance
##'
##' @param n_tests Numeric positive value. Number of tests.
##' @param prop_pos Proportion of tests that are returned positive
##'
##' @return Numeric. Number of potential infections that can be detected with
##'  testing
##' @export
get_n_infections <- function(n_tests, prop_pos) {
  is_probability(prop_pos)
  is_positive(n_tests)
  return(round(n_tests * prop_pos))
}
HopkinsIDD/tti documentation built on May 24, 2022, 1:11 a.m.