R/convert.mcmc.list.R

convert.mcmc.list <- function(x){
    if (!is.mcmc.list(x)){
        if (!is.mcmc(x)){
            if ("list" %in% class(x)){
                x <- lapply(x, as.mcmc)
            } else {
                x <- as.mcmc(x)
            }
        }
        if (!is.mcmc.list(x)){
            x <- mcmc.list(x)
        }
    }
    return(x)
}

Try the mcmcplots package in your browser

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

mcmcplots documentation built on May 2, 2019, 1:29 p.m.