R/expandSlash.R

expandSlash <-
structure(function (bb) 
{
    if (!is.list(bb)) 
        return(expandSlash(list(bb)))
    unlist(lapply(bb, function(x) {
        if (length(x) > 2 && is.list(trms <- slashTerms(x[[3]]))) 
            return(lapply(unlist(makeInteraction(trms)), function(trm) substitute(foo | 
                bar, list(foo = x[[2]], bar = trm))))
        x
    }))
}, source = c("function (bb) ", "{", "    if (!is.list(bb)) ", 
"        return(expandSlash(list(bb)))", "    unlist(lapply(bb, function(x) {", 
"        if (length(x) > 2 && is.list(trms <- slashTerms(x[[3]]))) ", 
"            return(lapply(unlist(makeInteraction(trms)), function(trm) substitute(foo | ", 
"                bar, list(foo = x[[2]], bar = trm))))", "        x", 
"    }))", "}"))

Try the frailtyHL package in your browser

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

frailtyHL documentation built on Dec. 1, 2019, 1:25 a.m.