# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#'
#' @title
#' window_intersect
#'
#' @description
#' given two intervals, figure out the intersection between the
#' first and the second
#'
#' NOTE that the intervals are treated as half-open (start,finish]
#' so that an event that happens exactly at time b is counted in
#' (a,b] but not in (b, c]
#'
#' @param a the first window; here, we use all three components
#' (start, finish, event)
#' @param b the second window; here, we only use the start and finish
#' time, and ignore any events
#' @return a window containing the exposure and events from a that takes place
#' during the time given by b; also, if a has an event and it takes
#' place during b, it is included
#'
#' @details TODO - should write a more detailed description
#'
#'
window_intersect <- function(a, b) {
.Call('dhstools_window_intersect', PACKAGE = 'dhstools', a, b)
}
#'
#' @title
#' cpp_compute_occ_exp
#'
#' @description
#' compute occurrences and exposures from lifelines,
#' age groups, and time intervals
#'
#' @param lambda a matrix of lifelines whose rows are units of observation (individuals),
#' and whose columns are (in order): start time, end time, event time
#' @param alpha a matrix whose rows are age groups and whose columns are
#' (in order): start time, end time (both starting from 0)
#' @param alpha_offset a vector with the birthdate of each unit of observation or,
#' more generally, the offset to use for the age groups in alpha
#' @param tau a matrix of time periods whose rows are units of observation (individuals),
#' and whose columns are (in order): start time, end time
#' @return a list containing two matrices, 'occ' and 'exp. each
#' matrix has one row for each unit of observation (individua) whose
#' columns are (for exp, in order): age group 1 exposure, ...,
#' last age group exposure; and (for occ, in order)
#' age group 1 number of events, ..., last age group number of events
#'
#' @details TODO - should write a more detailed description
#'
cpp_compute_occ_exp <- function(lambda, alpha, alpha_offset, tau) {
.Call('dhstools_cpp_compute_occ_exp', PACKAGE = 'dhstools', lambda, alpha, alpha_offset, tau)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.