R/strata.seroincidence.ests.R

Defines functions strata.seroincidence.by strata

Documented in strata strata.seroincidence.by

#' Extract strata from an object
#'
#' Generic method for extracting strata from objects. See [strata.seroincidence.by()]
#' @param x an object
#'
#' @return the strata of `x`
#'
strata <- function(x) {
  UseMethod("strata")
}

#' Extract the `Strata` attribute from an object, if present
#'
#' @param x any R object
#'
#' @return
#' * a [tibble::tibble()] with strata in rows, or
#' * `NULL` if `x` does not have a `"strata"` attribute
#' @export
#'
strata.seroincidence.by <- function(x) {
  attr(x, "Strata")
}

Try the serocalculator package in your browser

Any scripts or data that you put into this service are public.

serocalculator documentation built on April 3, 2025, 7:35 p.m.