R/methods-ScalarObject.R

Defines functions mkScalar

Documented in mkScalar

mkScalar <- function(obj) {
    switch(typeof(obj),
           character=.ScalarCharacter(obj),
           logical=.ScalarLogical(obj),
           integer=.ScalarInteger(obj),
           double=.ScalarNumeric(obj),
           stop("no scalar class implemented for type: ", typeof(obj)))
}

setMethod("show", "ScalarObject",
          function(object) {
              cat(object, "\n")
          })

setMethod("show", "ScalarCharacter",
          function(object) {
              if (is.na(object))
                  cat(NA, "\n")
              else
                  cat(sprintf('"%s"\n', object))
          })

Try the Biobase package in your browser

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

Biobase documentation built on Nov. 8, 2020, 6:52 p.m.