un.direct {NetworkToolbox} | R Documentation |
Convert Directed Network to Undirected Network
Description
Converts a directed network to an undirected network
Usage
un.direct(A, diagonal = 0)
Arguments
A |
Matrix or data frame. Adjacency matrix (network matrix) |
diagonal |
Numeric.
Number to be placed on the diagonal.
Defaults to |
Value
Returns a symmetric adjacency matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
# create a directed network
dir <- A * sample(c(0,1), size = length(A), replace = TRUE)
# undirect the directed network
undir <- un.direct(dir)
[Package NetworkToolbox version 1.4.2 Index]