setClass("Dimensions", representation(width = "numeric", 
  height = "numeric", depth = "numeric"), prototype = list(depth = 0), contains = "SBase")

setMethod("describe", "Dimensions", function(object) {
  paste(width(object), height(object), depth(object), sep = "x")

setMethod("width", "Dimensions", function(x) x@width)

 setGeneric("height", function(object) standardGeneric("height"))
setMethod("height", "Dimensions", function(object) object@height)

 setGeneric("depth", function(object) standardGeneric("depth"))
setMethod("depth", "Dimensions", function(object) object@depth)

setReplaceMethod("width", "Dimensions", function(x, value) {
  x@width <- value

 setGeneric("height<-", function(object, value) standardGeneric("height<-"))
setReplaceMethod("height", "Dimensions", function(object, value) {
  object@height <- value

 setGeneric("depth<-", function(object, value) standardGeneric("depth<-"))
setReplaceMethod("depth", "Dimensions", function(object, value) {
  object@depth <- value

Try the rsbml package in your browser

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

rsbml documentation built on Nov. 8, 2020, 8:09 p.m.