50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

reporttools (version 1.1.3)

checkDateSuccession: Check whether dates in two vectors are elementwise consecutive

Description

Given two vectors d1 and d2 of date type, this function outputs all entries d1j and d2j such that d1jd2j.

Usage

checkDateSuccession(d1, d2, pat, names = NA, lab = "", typ = c("R", "tex")[2])

Arguments

d1

Supposedly earlier dates.

d2

Supposedly later dates.

pat

Corresponding list of patient (observation) numbers.

names

Names of date vectors, of length 3.

lab

Label of the generated latex table.

typ

Type of output.

Value

A latex table is output.

Examples

Run this code
# NOT RUN {
set.seed(1977)
diagnosis <- as.Date(round(runif(10, min = 35000, max = 40000)), 
    origin = "1899-12-30")
death <- as.Date(round(runif(10, min = 35000, max = 40000)), 
    origin = "1899-12-30")

## check whether diagnosis was before death
checkDateSuccession(diagnosis, death, 1:10, names = c("Pat", 
    "diagnosis", "death"), lab = "tab: diag --> death") 

checkDateSuccession(diagnosis, death, 1:10, names = c("Pat", 
    "diagnosis", "death"), lab = "tab: diag --> death", typ = "R") 
# }

Run the code above in your browser using DataLab