R/subbars.R

subbars <-
structure(function (term) 
{
    if (is.name(term) || !is.language(term)) 
        return(term)
    if (length(term) == 2) {
        term[[2]] <- subbars(term[[2]])
        return(term)
    }
    stopifnot(length(term) >= 3)
    if (is.call(term) && term[[1]] == as.name("|")) 
        term[[1]] <- as.name("+")
    for (j in 2:length(term)) term[[j]] <- subbars(term[[j]])
    term
}, source = c("function (term) ", "{", "    if (is.name(term) || !is.language(term)) ", 
"        return(term)", "    if (length(term) == 2) {", "        term[[2]] <- subbars(term[[2]])", 
"        return(term)", "    }", "    stopifnot(length(term) >= 3)", 
"    if (is.call(term) && term[[1]] == as.name(\"|\")) ", "        term[[1]] <- as.name(\"+\")", 
"    for (j in 2:length(term)) term[[j]] <- subbars(term[[j]])", 
"    term", "}"))

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.