adj.upper.tri: Binary upper triangular adjacency matrix

Description Usage Arguments Details Value Examples

View source: R/gpav.R

Description

Compute a binary square upper triangular matrix where rows and columns correspond to the nodes' name of the graph g.

Usage

1

Arguments

g

a graph of class graphNELL representing the hierarchy of the class.

Details

The nodes of the matrix are topologically sorted (by using the tsort function of the RBGL package). Let's denote with adj our adjacency matrix. Then adj represents a partial order data set in which the class j dominates the class i. In other words, adj[i,j]=1 means that j dominates i; adj[i,j]=0 means that there is no edge between the class i and the class j. Moreover the nodes of adj are ordered such that adj[i,j]=1 implies i < j, i.e. adj is upper triangular.

Value

An adjacency matrix which is square, logical and upper triangular.

Examples

1
2
data(graph);
adj <- adj.upper.tri(g);

Example output

HEMDAG: Hierarchical Ensemble Methods for DAG-structured taxonomies
Please cite HEMDAG if you use it: see citation('HEMDAG') for details

HEMDAG documentation built on Feb. 12, 2021, 5:13 p.m.