R/checkMeasures.R

Defines functions checkMeasures

checkMeasures = function(measures, obj, aggr = NULL) {
  if (missing(measures) || is.null(measures)) {
    measures = list(getDefaultMeasure(obj))
  } else {
    measures = ensureVector(measures, n = 1L, cl = "Measure")
    assertList(measures, types = "Measure", min.len = 1L)
  }
  if (!is.null(aggr)) {
    measures = lapply(measures, setAggregation, aggr = aggr)
  }
  return(measures)
}

Try the mlr package in your browser

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

mlr documentation built on June 22, 2024, 10:51 a.m.