R/cohort.R

cohort <-
function(year, age, reset=F){
    n <- length(year); k <- length(age)
    stx <- year[1]-age[k]
    ft <- gl(n, k)
    ret <- array(year[ft]-age, dim=c(k,n), dimnames=list(age, year))
    if (reset) ret-stx+1 else ret
}

Try the ilc package in your browser

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

ilc documentation built on May 2, 2019, 5:07 a.m.