https://github.com/cran/epiR
Raw File
Tip revision: bcde1da105a2abcd7d1fe3ecf70619bc2a5bbcd8 authored by Mark Stevenson on 06 January 2014, 07:18:40 UTC
version 0.9-53
Tip revision: bcde1da
epi.offset.R
"epi.offset" <- function(id.names)
    {   total <- length(id.names)
        counts <- as.vector(table(id.names))
        offset <- c(1)
        for (i in 2:length(counts)-1)
                {var <- counts[i] + offset[i]
                 offset <- c(offset, var)   
                    }
                offset <- c(offset, total)
                return(offset)
                }   
back to top