R/testnull.R

.testnull <-
function(object, Prev, dat){

    if(object$deviance == object$null.deviance){
        if(Prev < 0.5) pred <- rep(0, nrow(dat))
        if(Prev >= 0.5) pred <- rep(1, nrow(dat))
    }
    else pred <- predict(object, dat, type="response")    
    return(pred)
}

Try the BIOMOD package in your browser

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

BIOMOD documentation built on May 2, 2019, 6:48 p.m.