tupla.matrix: Tupla Matrix

Description Usage Arguments Details Value Examples

View source: R/graph.utility.R

Description

Transform a Weighted Adjacency Matrix (wadj matrix) of a graph in a tupla, i.e. as a sequences of rows separated by blank and the weight of the edges, e.g nodeX nodeY score.

Usage

1
tupla.matrix(m, output.file = "net.file.gz")

Arguments

m

a weighted adjacency matrix of the graph. Rows and columns are examples. It must be a square named matrix.

output.file

name of the file of the to be written. The extension of the file can be or plain format (".txt") or compressed (".gz").

Details

Only the non-zero interactions are kept, while the zero interactions are discarded. In other words in the output.file are reported only those nodes having a weight different from zero.

Value

the weighted adjacency matrix as tupla is stored in the output.file.

Examples

1
2
3
4
data(wadj);
tmpdir <- paste0(tempdir(),"/");
tupla.matrix(W, output.file=paste0(tmpdir,"graph.edges.txt.gz"));
tupla.matrix(W, output.file=paste0(tmpdir,"graph.edges.txt"));

gecko515/HEMDAG documentation built on Oct. 18, 2019, 6:34 a.m.