Learn R Programming

wrMisc (version 1.9.0)

pairsAsPropensMatr: Convert pairs of node-names to non-oriented propensity matrix Numerous network query tools produce a listing of pairs of nodes (with one pair of nodes per line). Using this function such a matrix (or data.frame) can be combined to this more comprehensive view as propensity-matrix. Note, this has been primarily developed for undireted interaction networks, the resulting propensity-matrix does not show any orientation any more. In a number of applications (eg in protein-protein interaction networks, PPI) the resulting matrix may be rather sparse.

Description

Convert pairs of node-names to non-oriented propensity matrix

Numerous network query tools produce a listing of pairs of nodes (with one pair of nodes per line). Using this function such a matrix (or data.frame) can be combined to this more comprehensive view as propensity-matrix. Note, this has been primarily developed for undireted interaction networks, the resulting propensity-matrix does not show any orientation any more. In a number of applications (eg in protein-protein interaction networks, PPI) the resulting matrix may be rather sparse.

Usage

pairsAsPropensMatr(mat, callFrom = NULL, silent = FALSE)

Arguments

mat

(matrix) main input, matrix of interaction partners with each line as a separate pair of nodes; the first two columns should contain identifiers of the nodes

callFrom

(character) allow easier tracking of message(s) produced

silent

(logical) suppress messages

Value

This function returns matrix or data.frame

See Also

uses typically input from filterNetw

Examples

Run this code
# NOT RUN {
pairs3L <- matrix(LETTERS[c(1,3,3, 2,2,1)], ncol=2)      # loop of 3
(netw13pr <- pairsAsPropensMatr(pairs3L))   # as prop matr

# }

Run the code above in your browser using DataLab