R/summarizeExperiments.R

Defines functions summarizeExperiments

Documented in summarizeExperiments

#' @title Quick Summary over Experiments
#'
#' @description
#' Returns a frequency table of defined experiments.
#' See \code{\link{ExperimentRegistry}} for an example.
#'
#' @templateVar ids.default all
#' @template ids
#' @param by [\code{character}]\cr
#'   Split the resulting table by columns of \code{\link{getJobPars}}.
#' @template expreg
#' @return [\code{\link{data.table}}] of frequencies.
#' @export
#' @family Experiment
summarizeExperiments = function(ids = NULL, by = c("problem", "algorithm"), reg = getDefaultRegistry()) {
  assertRegistry(reg, class = "ExperimentRegistry")
  assertCharacter(by, any.missing = FALSE, min.chars = 1L, min.len = 1L, unique = TRUE)
  tab = getJobPars(ids = ids, reg = reg)
  if (!setequal(by, c("problem", "algorithm")))
    tab = unwrap(tab)
  tab[, list(.count = .N), by = by]
}

Try the batchtools package in your browser

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

batchtools documentation built on April 20, 2023, 5:09 p.m.