powered by
This function will write the .node and .edge files necessary for visualization with the BrainNet Viewer software (see Reference below).
write_brainnet(g, node.color = "none", node.size = "constant", edge.wt = NULL, file.prefix = "")
The igraph graph object of interest
igraph
Character string indicating whether to color the vertices or not (default: 'none')
'none'
Character string indicating what size the vertices should be; can be any vertex-level attribute (default: 'constant')
'constant'
Character string indicating the edge attribute to use to return a weighted adjacency matrix (default: NULL)
NULL
Character string for the basename of the .node and .edge files that are written
For the .node file, there are 6 columns:
Column 1: x-coordinates
Column 2: y-coordinates
Column 3: z-coordinates
Column 4: Vertex color
Column 5: Vertex size
Column 6: Vertex label
The .edge file is the graph's associated adjacency matrix; a weighted adjacency matrix can be returned by using the edge.wt argument.
edge.wt
Xia M, Wang J, He Y (2013). BrainNet Viewer: a network visualization tool for human brain connectomics. PLoS One, 8(7):e68910.
# NOT RUN { write_brainnet(g, node.color='community', node.size='degree', edge.wt='t.stat') # }
Run the code above in your browser using DataLab