R/hooks.R

Defines functions lava.tobit.color.hook lava.tobit.sim.hook lava.tobit.init.hook

Documented in lava.tobit.color.hook lava.tobit.init.hook lava.tobit.sim.hook

##' @export
lava.tobit.init.hook <- function(x,...) {
    x$attributes$binary <- list()
    return(x)
    ##  nodeDataDefaults(x,"binary") <- FALSE; x
}

##' @export
lava.tobit.sim.hook <- function(x,data,...) {
    if (length(binary(x))>0)
        data[,binary(x)] <- (data[,binary(x)]>0)*1
    return(data)
}

##' @export
lava.tobit.color.hook <- function(x,subset=lava::vars(x),...) {
    return(list(vars=intersect(subset,binary(x)),col="indianred1"))
}

Try the lava.tobit package in your browser

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

lava.tobit documentation built on May 30, 2017, 6:39 a.m.