R/get_modelfit.R

Defines functions get_modelfit

## Wrap for test goodnes of fit as it can produce an error
get_modelfit <- function(object, x, method, grouping) {
    ans <- try(get_neilltest(object, x, method, grouping),silent=TRUE)
    if(inherits(ans,"try-error")){
        ans <- NA
    } else{
        if(is.character(ans)){
           if(ans=="error1") ans <- "Too many groups in 'grouping'"
           if(ans=="error2") ans <- "Too few groups in 'grouping'"
        } else{
          ans <- as.numeric(round(ans[,2],3))  
       }        
    }
    return(ans)
}

Try the drLumi package in your browser

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

drLumi documentation built on May 2, 2019, 2:45 p.m.