Learn R Programming

HEMDAG (version 2.1.3)

tupla.matrix: Tupla Matrix

Description

Trasform 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

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

Arguments

m

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

compressed

boolean value:

  • TRUE (def.): the output file will be a gz compressed format;

  • FALSE: the output file will be a plain text format;

output.file

name of the file of the to be written

Value

if compressed=TRUE the weighted adjacency matrix as tupla is stored in a compressed gz, otherwise (compressed=FALSE) it is stored in a plain text file.

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

Examples

Run this code
# NOT RUN {
data(wadj);
tupla.matrix(W,compressed=TRUE, output.file="tupla.wadj.gz");
tupla.matrix(W,compressed=FALSE, output.file="tupla.wadj.txt");
# }

Run the code above in your browser using DataLab