R/nclones.list.R

Defines functions nclones.list

Documented in nclones.list

nclones.list <-
function(x, ...)
{
    if (!is.null(attr(x, "n.clones"))) {
        nc <- attr(x, "n.clones")
    } else {
        klist <- lapply(x, nclones.default)
        nc <- unique(unlist(klist))
        if (is.null(nc))
            return(NULL)
        if (length(nc) > 1)
            stop("non unique value")
        method <- lapply(klist, function(z) attr(z, "method"))
        method[sapply(method, is.null)] <- NA
        attr(nc, "method") <- unlist(method)
    }
    nc
}

Try the dclone package in your browser

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

dclone documentation built on July 10, 2023, 2:03 a.m.