Learn R Programming

brainGraph (version 0.55.0)

write.brainnet: Write files to be used for visualization with BrainNet Viewer

Description

This function will write the .node and .edge files necessary for visualization with the BrainNet Viewer software (see Reference below).

Usage

write.brainnet(g, node.color = c("none", "community", "lobe"),
  node.size = "constant", file.prefix = "")

Arguments

g
A graph
node.color
Character string indicating whether to color the nodes or not; can be 'none', 'lobe', or 'community'
node.size
Character string indicating what size the nodes should be; can be any vertex-level attribute (default: 'constant')
file.prefix
Character string for the basename of the .node and .edge files that are written

Details

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.

References

Xia M, Wang J, He Y (2013). BrainNet Viewer: a network visualization tool for human brain connectomics. PLoS One, 8(7):e68910.