aggValue {TreeSummarizedExperiment} | R Documentation

## Perform data aggregations based on the available tree structures

### Description

`aggValue` aggregates values on the leaf nodes of a tree to a specific arbitrary level of the tree. The level is specified via the nodes of the tree. Users could decide on which dimension (row or column) and how should the aggregation be performed.

### Usage

    aggValue(
      x,
      rowLevel = NULL,
      rowBlock = NULL,
      colLevel = NULL,
      colBlock = NULL,
      FUN = sum,
      assay = NULL,
      message = FALSE
    )

### Arguments

`x` | A `TreeSummarizedExperiment` object.
`rowLevel` | A numeric (node numbers) or character (node labels) vector. It provides the level on the tree that data is aggregated to. The aggregation is on the row dimension. The default is `rowLevel = NULL`, and no aggregation is performed.
`rowBlock` | A column name in the `rowData` to separate the aggregation.
`colLevel` | A numeric (node numbers) or character (node labels) vector. It provides the level on the tree that data is aggregated to. The aggregation is on the column dimension. The default is `colLevel = NULL`, and no aggregation is performed.
`colBlock` | A column name in the `colData` to separate the aggregation.
`FUN` | A function to be applied on the aggregation. It's similar to the `FUN` in `apply`.
`assay` | A integer scalar or string indicating which assay of `x` to use in the aggregation. If NULL, all assay tables are used in aggregation.
`message` | A logical value. The default is TRUE. If TRUE, it will print out the running process.

### Value

A `TreeSummarizedExperiment` object or a `matrix`. The output has the same class of the input `x`.

### Author(s)

Ruizhu HUANG

### See Also

`aggTSE`

[Package TreeSummarizedExperiment version 2.2.0 Index]