R/makeUsedAvail.formula.R

Defines functions makeUsedAvail.formula

Documented in makeUsedAvail.formula

makeUsedAvail.formula <- 
function(formula, data = parent.frame(), ...)
{
    mf <- match.call(expand.dots = FALSE)
    mm <- match(c("formula", "data"), names(mf), 0)
    mf <- mf[c(1, mm)]
    mf$drop.unused.levels <- TRUE
    mf[[1]] <- as.name("model.frame")
    x <- eval(mf, parent.frame())
    rid <- attr(terms(x), "response")
    YNAME <- colnames(x)[rid]
    y <- model.response(x, "numeric")
    x <- data.frame(x[,-rid])
    eval(parse(text=paste(YNAME, "<-y", sep="")))
    eval(parse(text=paste("makeUsedAvail.default(x=x, y=",YNAME,", m=m, ...)", sep="")))
}

Try the ResourceSelection package in your browser

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

ResourceSelection documentation built on July 9, 2023, 5:58 p.m.