R/getStatisticByName.R

##
## method getStatisticByName to retrieve each statistic column
##

##
## StatisticsForPREDA - getStatisticByName
##

setMethod("getStatisticByName", "StatisticsForPREDA", function(.Object, analysisName) {

analysesNames<-slot(.Object, "analysesNames")

    if (!(analysisName %in% analysesNames)) {
    stop("The selected analysisName is not available!")
    } else {
    col_id<-which(analysesNames==analysisName)
    statistics<-slot(.Object, "statistic")
    selected_statistic<-statistics[,col_id]
    return(selected_statistic)
    }

})

Try the PREDA package in your browser

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

PREDA documentation built on May 6, 2019, 2:07 a.m.