R/print.lifertableCI.R

Defines functions print.lifertableCI

Documented in print.lifertableCI

#' @describeIn lifertable
#'     Print a \code{lifertableCI} object, this is the object showing the Confidence Interval
#'
#' @param title If \code{TRUE} (the default), displays the title of the object (this is for internal use only).
#'
#' @export
#'
print.lifertableCI <- function(x, title = TRUE, ...) {
  if (title) {
    cat("\n   -----  CONFIDENCE INTERVALS  -----\n")
    cat("------ USING JACKKNIFE ESTIMATION ------\n\n")
  }
  if ("Lower Limit" %in% names(x)){
    print(unclass(x))
    cat("\n\n")
  } else if ("Ro" %in% names(x)) {
    for (i in seq_along(x) ) {
      cat(" - PARAMETER :", names(x)[i], "\n\n")
      print(as.data.frame(x[[i]]), row.names = FALSE, title = FALSE)
      cat("\n")
    }
  } else {
    print(as.data.frame(x), row.names = FALSE, title = FALSE)
    cat("\n")
  }
  if (title)
    cat(" -------------------------\n\n")
  invisible(x)
}

Try the Lifertable package in your browser

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

Lifertable documentation built on April 12, 2025, 1:43 a.m.