Learn R Programming

ndtv (version 0.13.4)

export.dot: Export a network file as Graphviz .dot formatted text file.

Description

A crude exporter for saving out a network in the Graphviz .dot format. https://graphviz.org/content/dot-language

Usage

export.dot(x, file = "", coords = NULL, all.dyads = FALSE, 
            vert.attrs = NULL, edge.attrs = NULL)

Value

Returns nothing but creates a file in .dot format: https://graphviz.org/content/dot-language

Arguments

x

The network object to be exported

file

The file name where network should be saved

coords

Optional node coordinates to include

all.dyads

FALSE, a numeric value, or a symetric matrix of distances providing the desired lengths for all dyads.. If numeric, entries are written out for all possible dyads in the network, and the numeric value will be used to fill in the values for all the dyads in the matrix not linked by an edge (see default.dist param to layout.distance). This is necessary for some uses cases, but will generate dramatically larger files and slower performance. For the matrix and numeric cases, the values will be written as Graphviz 'len' edge attributes, and the values of edge.attrs will be ignored.

vert.attrs

optional character vector listing the names of any vertex attributes of the network that should be included as attributes of the nodes in the Graphviz dot file. (e.g. 'label', 'width')

edge.attrs

optional character vector listing the names of any edge attributes of the network that should be included as attributes of edges in the Graphviz dot file. (e.g. 'weight','penwidth')

Author

Skye Bender-deMoll

Details

A crude exporter for saving out a network in the Graphviz .dot format. https://graphviz.org/content/dot-language

References

https://graphviz.org/content/dot-language

Examples

Run this code
 library(network)
 net <- network.initialize(5)
 net[1,] <-1
 net[2,3] <-2
 export.dot(net,file="testNet.dot")
 
 # clean up file afterwords (just for testing)
 file.remove("testNet.dot")

Run the code above in your browser using DataLab