#' @title Get columns containing objective values.
#'
#' @details In ecr3 performance assessment a convention is that objective values
#' are stored in columns \dQuote{y1, ..., yn} where n is the number of objectives.
#' This function determines the objective columns and is called internally by most
#' functions of the performance assessment module.
#'
#' @param x [\code{data.frame}]\cr
#' Data frame.
#' @return [\code{character}] Column names of objective columns.
getYColumns = function(x) {
ns = colnames(x)
if (any(is.na(ns)))
BBmisc::stopf("[ecr3] Impossible to deduce columns of objectives, since (some) column names are missing.")
obj.cols = ns[grepl("^y[0-9]+", ns)]
return(obj.cols)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.