R/model.frame.binaryChoice.R

model.frame.binaryChoice <- function (formula, ...) {
    dots <- list(...)
    nargs <- dots[match(c("data", "na.action", "subset"), names(dots), 0 )]
    if ( length(nargs) > 0 || is.null(formula$model)) {
        fcall <- formula$call
        fcall$method <- "model.frame"
        fcall[[1]] <- as.name("binaryChoice")
        fcall[names(nargs)] <- nargs
        env <- environment(formula$terms)
        if (is.null(env)) {
            env <- parent.frame()
        }
        result <- eval(fcall, env, parent.frame())
    } else {
      result <- formula$model
    }

    return( result )
}

Try the sampleSelection package in your browser

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

sampleSelection documentation built on Jan. 13, 2021, 7:49 p.m.