R/imExposomeSet-familyNames.R

#' @describeIn imExposomeSet Getter to obtain the families's names of the
#' family of each exposure.
#' @param by.exposure If set to \code{TRUE} ir returns the family which
#' each exposure belongs
setMethod(
    f = "familyNames",
    signature = "imExposomeSet",
    definition = function(object, by.exposure = FALSE) {
        if(by.exposure) {
            fm <- as.character(fData(object)$Family)
            names(fm) <- fData(object)$Exposure
            return(fm)
        } else {
            unique(as.character(fData(object)$Family))
        }
    }
)

Try the rexposome package in your browser

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

rexposome documentation built on March 13, 2021, 2:01 a.m.