Counts rows for which both explicitly supplied event and time columns are present, and the events among them.
The event column must be logical or numeric binary coding: FALSE/TRUE
or 0/1. Rows missing either column are excluded from the
analysable cohort.
Examples
d <- data.frame(dead = c(1, 1, 0, 0, 0), iv_dead = 1:5)
cohort_counts(d, event = "dead", time = "iv_dead")
#> $n
#> [1] 5
#>
#> $n_events
#> [1] 2
#>
#> $n_censored
#> [1] 3
#>