R/show_methods.R

#' Generic show method for distribution objects
#'
#' The distribution objects have an internal structure that is used for caching purposes.
#' Using the default `show` method gives the illusion of duplicate values.
#' This show method aims to avoid this confusion.
#' @param object A distribution object.
#' @importFrom methods classLabel show
#' @export
setMethod("show",
          signature = signature(object = "distribution"),
          definition = function(object) {
            msg = paste("Reference class object of class", classLabel(class(object)), "\n")
            cat(msg)
            cat('Field "xmin": \n')
            print(object$getXmin())
            cat('Field "pars": \n')
            print(object$getPars())
            cat('Field "no_pars": \n')
            print(object$no_pars)
          }
)

Try the poweRlaw package in your browser

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

poweRlaw documentation built on May 29, 2024, 10:01 a.m.