collapse: Collapse the vistla tree into a pairwise graph

View source: R/collapse.R

collapseR Documentation

Collapse the vistla tree into a pairwise graph

Description

Collapse the vistla tree into a pairwise graph

Usage

collapse(x, aggregate = c("max", "sum", "none"))

Arguments

x

vistla object or a vistla_hierarchy object to collapse.

aggregate

score aggregation mode. "max" is the maximal score for this edge over all paths in the tree. For raw vistla scores it means the score of the widest path this edge was a part of; for ensemble scores, it corresponds to the count of the most often appearing path with this edge. "sum" is the sum of scores. Makes little sense for raw vistla scores; for ensemble scores it corresponds to the total count of this edge over all paths in the ensemble. "none" returns a vector of scores over all paths, which can be processed anyhow the user desires.

Value

A pairlist representation of the graph resulting from the tree collapse. The result is a data frame with the following columns. A & B are the ends of the edge, in order where A is closer to root than B (interpretation depends on the flow parameter used in vistla invocation); score is the score aggregated according to the aggregate argument; finally paths is the count of paths which included this edge.

Examples

## Not run: 
 data(junction)
 v<-vistla(Y~.,data=junction)
 collapse(v)

## End(Not run)

vistla documentation built on April 4, 2025, 2:08 a.m.