R/mcmc_samples.R

#' @title Function \code{mcmc_samples}
#' @description Get MCMC samples from a \code{Chain} object 
#' or a list of \code{Chain} objects generated by \code{fbseq()}.
#' @export
#' @return a data frame of MCMC samples
#' @param obj a \code{Chain} object or list of \code{Chain} objects generated by \code{fbseq()}.
mcmc_samples = function(obj){
  if(class(obj) == "Chain"){
    flatten(obj)
  } else {
    do.call("rbind", lapply(obj, flatten))
  }
}
wlandau/fbseq documentation built on May 4, 2019, 8:43 a.m.