R/bayesx_logfile.R

Defines functions bayesx_logfile

Documented in bayesx_logfile

bayesx_logfile <- function(x, model = 1L)
{
  x <- get.model(x, model)
  bayesx.log <- NULL
  if(inherits(x, "bayesx")) {
    bayesx.log <- x[[model]]$bayesx.run$log
    if(length(bayesx.log) < 2L || inherits(bayesx.log, "integer")) {
      if(!is.null(x[[model]]$logfile))
        bayesx.log <- x[[model]]$logfile
    }
    if(!is.null(bayesx.log)) {
      if(!is.character(bayesx.log))
        print(bayesx.log)
      else
        writeLines(bayesx.log)
    }
  }
  if(is.null(bayesx.log))
    warning("logfile is not available!")

  return(invisible(bayesx.log))
}

Try the R2BayesX package in your browser

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

R2BayesX documentation built on Oct. 20, 2023, 3:01 p.m.