R/opticut_distdot.R

Defines functions .opticut_dist

.opticut_dist <- function(x, make_dist=FALSE) {
    List <-c(
        "gaussian",
        "poisson",
        "binomial",
        "negbin",
        "beta",
        "zip",
        "zinb",
        "zip2",
        "zinb2",
        "rsf",
        "rspf")
    if (missing(x))
        return(List)
    if (is.function(x))
        return(FALSE)
    if (is.character(x)) {
        link <- strsplit(x, ":", fixed=TRUE)[[1L]][2L]
        x <- strsplit(x, ":", fixed=TRUE)[[1L]][1L]
        x <- match.arg(x, List)
        full <- if (is.na(link))
            x else paste(x, link, sep=":")
        if (make_dist)
            return(full) else return(x %in% List)
    }
    FALSE
}

Try the opticut package in your browser

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

opticut documentation built on May 2, 2019, 5:09 a.m.