R/DC-Show.R

#' Show class
#' 
#' This is a virtual class to be contained in other class definitions. It overrides the default show method and is intended to be used with the aoos class system (\code{\link{defineClass}}). The show method will simply look for a method \code{show} defined as member of a class definition.
#' 
#' 
#' @seealso \link{defineClass}
#' @export
#' @rdname Show
#' @examples
#' ClassWithShowMethod <- defineClass("ClassWithShowMethod", contains = "Show", {
#'   show <- function() print(summary(.self))
#' })
#' 
#' ClassWithShowMethod()
setClass("Show", contains = "VIRTUAL")

#' @export
#' @rdname Show
#' 
#' @param object an object inheriting from \code{Show}
setMethod("show", "Show", function(object) {
  object$show()
})

Try the aoos package in your browser

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

aoos documentation built on May 2, 2019, 3:47 p.m.