results_apply: Apply a function to a results list

View source: R/helpers.r

results_applyR Documentation

Apply a function to a results list

Description

Descend a result-tree

Usage

results_apply(object, dataset, model, comparison, fn, depth = "comparison")

Arguments

object

The list of results returned by get_result

dataset

The name of the dataset you want to restrict the traversal to - optional, and if omitted all datasets will be traversed.

model

The name of the model you want to restrict the traversal to - optional, and if omitted all models will be traversed.

comparison

The name of the comparison you want to restrict the traversal to - optional, and if omitted all comparisons will be traversed.

fn

The function that should be applied to each dds object encountered

depth

The depth to which traversal should be carried out.

Details

DESdemonA creates a Dataset > Model > Comparison nested list, with everything stored at the third level of this list. results_apply provides a way to traverse this list, applying a function to each dds object, and reporting the results of that function aggregated to a particular level.

For instance, the counts are universal to every model within a dataset, and also to every comparison done within each model in that dataset. But the actual fitted coeffecients are specific to each comparison.

Value

A (nested) list of values that represent the return value of fn on the corresponding dds

Author(s)

Gavin Kelly


FrancisCrickInstitute/DESdemonA documentation built on Jan. 2, 2023, 8:08 p.m.