R/print.R

Defines functions print.ADCube print.SimCop

Documented in print.ADCube print.SimCop

#' Print basic information on a copula
#'
#' Prints basic information on a copula created with the methods in this package.
#'
#' @param x an object of \code{\link{class}} \sQuote{SimCop}.
#' @param \dots not used.
#'
#' @author  Berwin A. Turlach \email{berwin.turlach@@gmail.com}
#'
#' @keywords print
#'
#' @export
print.SimCop <- function(x, ...){
  param <- get("param", envir=environment(x))
  type <- get("type", envir=environment(x))
  if(length(param) == 0){
    cat(paste0(type[2], " copula of class ", type[1], ", with no parameters:"), "\n")
  }else{
    cat(paste0(type[2], " copula of class ", type[1], ", with parameters:"), "\n")
    for(i in 1:length(param)){
      cat(names(param)[i], "\n")
      print(param[[i]])
    }
  }
    if(exists("pdfCopula", envir = environment(x))){
      cat("Has a function to evaluate its PDF in its environment\n")
   }else{
      cat("Does not have a function to evaluate its PDF in its environment\n")
   }
  invisible(x)
}

#' Print method for cubes
#'
#' \code{\link{print}} method for \sQuote{ADCube} objects.
#'
#' Currently, the component \sQuote{\code{val}} of the \sQuote{ADCube} object is printed using \code{base::print}.
#'
#'
#' @param x an object of \code{\link{class}} \sQuote{ADCube}.
#' @param \dots arguments passed on to \code{base::print}.
#'
#' @keywords internal
#'
#' @export
print.ADCube <- function(x, ...)
  print(x$val, ...)

Try the SimCop package in your browser

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

SimCop documentation built on April 13, 2025, 5:09 p.m.