File: summarizeExperiments.R

package info (click to toggle)
r-cran-batchtools 0.9.15%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,416 kB
  • sloc: ansic: 172; sh: 156; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#' @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]
}