getResultVars: Get variable groups of reduced results.

View source: R/reduceResultsExperiments.R

getResultVarsR Documentation

Get variable groups of reduced results.

Description

Useful helper for e.g. package plyr and such.

Usage

getResultVars(data, type = "group")

Arguments

data

[ReducedResultsExperiments]
Result data.frame from reduceResultsExperiments.

type

[character(1)]
Can be “prob” (prob + pars), “prob.pars” (only problem pars), “algo” (algo + pars), “algo.pars” (only algo pars), “group” (prob + problem pars + algo + algo pars), “result” (result column names). Default is “group”.

Value

[character]. Names of of columns.

Examples

reg = makeExperimentRegistry("BatchExample", seed = 123, file.dir = tempfile())
addProblem(reg, "p1", static = 1)
addProblem(reg, "p2", static = 2)
addAlgorithm(reg, id = "a1",
  fun = function(static, dynamic, alpha) c(y = static*alpha))
addAlgorithm(reg, id = "a2",
  fun = function(static, dynamic, alpha, beta) c(y = static*alpha+beta))
ad1 = makeDesign("a1", exhaustive = list(alpha = 1:2))
ad2 = makeDesign("a2", exhaustive = list(alpha = 1:2, beta = 5:6))
addExperiments(reg, algo.designs = list(ad1, ad2), repls = 2)
submitJobs(reg)
data = reduceResultsExperiments(reg)
library(plyr)
ddply(data, getResultVars(data, "group"), summarise, mean_y = mean(y))

BatchExperiments documentation built on March 21, 2022, 5:06 p.m.