R/as_incidence.R

Defines functions as_incidence.incidence2 as_incidence.default as_incidence

Documented in as_incidence as_incidence.default as_incidence.incidence2

#' Coerce to an incidence object
#'
# -------------------------------------------------------------------------
#' Generic for coercion to an `<incidence2>` object.
#'
# -------------------------------------------------------------------------
#' @param x An \R object.
#'
#' @param ... Additional arguments to be passed to or from other methods.
#'
# -------------------------------------------------------------------------
#' @return An `<incidence2>` object.
#'
# -------------------------------------------------------------------------
#' @export
as_incidence <- function(x, ...) {
    UseMethod("as_incidence")
}

#' @rdname as_incidence
#' @export
as_incidence.default <- function(x, ...) {
    .stopf_argument("Not implemented for class [%s].", paste(class(x), collapse = ", "))
}

#' @rdname as_incidence
#' @export
as_incidence.incidence2 <- function(x, ...) {
    x
}

Try the incidence2 package in your browser

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

incidence2 documentation built on June 22, 2024, 11:05 a.m.