Description Usage Arguments Details Value Examples
View source: R/makeSymmetric.R
Convert a network in source-target-weight format to symmetric matrix
1 | makeSymmetric(x, verbose = FALSE)
|
x |
(data.frame) three columns, with source node, target node, and edge weight. Entries must include universe of nodes; those with missing edges must be included as having edge weight NA |
verbose |
(logical) print messages |
A common format for network representation is to use a three column table listing source node, target node, and weight. This is the format netDx uses for network integration and visualization in Cytoscape. However, some functionality requires a square symmetric adjacency matrix. This function takes as input the three-column format and converts to the adjacency matrix. NOTE: Symmetric attribute is assumed, and the function automatically sets a[i,j] = a[j,i]. Diagonal is assumed to have value of 1.0. Finally missing edges will be assigned NA values.
(matrix) symmetric adjacency matrix
1 2 3 | src <- c("A","B"); tgt <- c("C","C")
cur <- data.frame(source=src,target=tgt,weight=c(0.3,0.8))
makeSymmetric(cur)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.