R/printTableContinuous.R

Defines functions printTableContinuous

Documented in printTableContinuous

#' Prints the means and the ESS of the continuous parameters
#' 
#' @importFrom utils write.csv
#' 
#' @param output A list of convenience.diag type
#' @param filename A filename to save the table, if NULL the table will be printed
#'  
#' @export

printTableContinuous <- function(output, filename = NULL){
  
  df_continuous <- as.data.frame(output$continuous_parameters$means)
  colnames(df_continuous) <- "means"
  df_continuous$ESS <- rowSums(output$continuous_parameters$ess)
  
  if( is.null(filename) ){
    return(df_continuous)
  } else{
    write.csv(df_continuous, file = filename)
  }
}
lfabreti/convenience documentation built on June 17, 2022, 8:12 a.m.