gatherParameters: Extracts the parameters from the simulation()-Object

View source: R/simulationList.R

gatherParametersR Documentation

Extracts the parameters from the simulation()-Object

Description

Basically, it is a helper function for gatherStatistics(). It extracts the parameters from the simObject$results and creates a data.frame from this. Every used parameter gets its own column. Every row corresponds to one object in simObject$results. If a object A from simObject$results does not contain a parameter P that another object B does, then the row for object A will have "" in the column for the parameter P.

Usage

gatherParameters(simObject)

Arguments

simObject

An object returned by simulation()

Value

A data.frame with rows for every object in simObject$results and columns for the used parameter.

Author(s)

MarselScheer

Examples

#' # this function generates pValues 
myGen <- function(n, n0) {
  list(procInput=list(pValues = c(runif(n-n0, 0, 0.01), 
       runif(n0))), groundTruth = c(rep(FALSE, times=n-n0), rep(TRUE, times=n0)))
}

# need some simulation()-Object I can work with 
sim <- simulation(replications = 3, list(funName="myGen", fun=myGen, n=200, n0=c(50,100)), 
list(list(funName="BH", fun=function(pValues, alpha) BH(pValues, alpha, silent=TRUE), 
  alpha=c(0.25, 0.5)),
list(funName="holm", fun=holm, alpha=c(0.25, 0.5),silent=TRUE)))

gatherParameters(sim)

mutoss documentation built on March 31, 2023, 8:46 p.m.