R/offset_values_extract.R

Defines functions offset_values_extract

Documented in offset_values_extract

## File Name: offset_values_extract.R
## File Version: 0.101

offset_values_extract <- function(formula, data )
{
    Xdes2 <- stats::model.frame( formula=formula, data=data )
    ind_offset <- attr( attr(Xdes2,'terms'), 'offset' )
    N <- nrow(Xdes2)
    if ( length(ind_offset) > 0 ){
        offset_values <- Xdes2[, ind_offset ]
    } else {
        offset_values <- rep(0,N)
    }
    return(offset_values)
}
alexanderrobitzsch/mdmb documentation built on July 18, 2024, 11:14 p.m.