edgelist2adjmatrix: Convert edge list to network matrix

Description Usage Arguments Value Examples

View source: R/edgelist2adjmatrix.R

Description

The function is to convert edge list to network matrix.

Usage

1
edgelist2adjmatrix(edgelist, genes, cutoff = 0, directed = F)

Arguments

edgelist

a data frame of edge list of a network, in which columns are regulators, targets and edge weights.

genes

gene names to name the rows and columns of the output network matrix.

cutoff

the threshold to cut the edge list.

directed

logical, to create directed or undirected (symmetric) network matrix.

Value

edgelist2adjmatrix returns a network matrix.

Examples

1
2
3
4
5
6
7
8
##load data
library(RLowPC)
data(gnwdata)
data.exp<-gnwdata$size100$ts1[,-c(1:3)]
genes<-colnames(data.exp)
ref.edge<-gnwdata$size100$net1
ref.edge[,3]<-1
ref.adj<-edgelist2adjmatrix(ref.edge,genes,directed=F)

wyguo/RLowPC documentation built on May 28, 2017, 7:34 a.m.