R/radiationInfo-methods.R

#####
# RADIATION SLOT GETTERS/SETTERS ----
#####

#' radiationInfo Generic
#'
#' Generic for radiationInfo method
#'
#' @examples
#' radiationInfo(clevelandSmall)
#'
#' @param object A \code{RadioSet} object
#'
#' @return a \code{data.frame} with the radiation annotations
setGeneric("radiationInfo", function(object) standardGeneric("radiationInfo"))
#' @describeIn RadioSet Returns the annotations for all the radiations tested
#'   in the RadioSet
#' @export
setMethod(radiationInfo, "RadioSet", function(object){
  object@radiation
})

#' radiationInfo<- Generic
#'
#' Generic for radiationInfo replace method
#'
#' @examples

#' radiationInfo(clevelandSmall) <- radiationInfo(clevelandSmall)
#'
#'
#' @param object The \code{RadioSet} to replace radiation info in
#' @param value A \code{data.frame} with the new radiation annotations
#'
#' @return Updated \code{RadioSet}
setGeneric("radiationInfo<-", function(object, value)
  standardGeneric("radiationInfo<-"))
#' @describeIn RadioSet Update the radiation annotations
#' @export
setReplaceMethod("radiationInfo",
                 signature = signature(object="RadioSet",value="data.frame"),
                 function(object, value){
  object@radiation <- value
  object
})

Try the RadioGx package in your browser

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

RadioGx documentation built on Nov. 8, 2020, 8:21 p.m.