R/AromaMicroarrayDataSet.EXT.R

setMethodS3("as.AromaMicroarrayDataSetTuple", "AromaMicroarrayDataSet", function(this, ...) {
  classNames <- class(this)
  classNames <- sprintf("%sTuple", classNames)
  methodNames <- sprintf("as.%s", classNames)

  # Try first as.Nnn() method available
  for (kk in seq_along(methodNames)) {
    methodName <- methodNames[kk]
    if (exists(methodName, mode="function")) {
      fcn <- get(methodName, mode="function")
      res <- fcn(this, ...)
      return(res)
    }
  } # for (kk ...)

  throw("Failed to coerce ", class(this)[1], ", to an AromaMicroarrayDataSetTuple: ", getFullName(this))
})


setMethodS3("as.AromaMicroarrayDataSetList", "AromaMicroarrayDataSet", function(this, ...) {
  classNames <- class(this)
  classNames <- sprintf("%sList", classNames)
  methodNames <- sprintf("as.%s", classNames)

  # Try first as.Nnn() method available
  for (kk in seq_along(methodNames)) {
    methodName <- methodNames[kk]
    if (exists(methodName, mode="function")) {
      fcn <- get(methodName, mode="function")
      res <- fcn(this, ...)
      return(res)
    }
  } # for (kk ...)

  throw("Failed to coerce ", class(this)[1], ", to an AromaMicroarrayDataSetList: ", getFullName(this))
})

Try the aroma.core package in your browser

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

aroma.core documentation built on June 25, 2024, 1:15 a.m.