r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
407 stars 56 forks source link

Default plot() method #77

Closed dhomme closed 8 years ago

dhomme commented 8 years ago

A default plot() method similar to print() would be a nice feature.

plot.R6 <- function(x, ...) {
  if (is.function(x$plot)) {
    x$plot(...)
  } else {
    stop(paste("No plot function defined in class: ", paste(class(s1), collapse = " > ")))
  }
}