
This function writes a graph in a PAFit_net
object to an output file. Accepted file formats are the edgelist format or the gml
format.
graph_to_file(net_object, file_name, format = "edgelist")
The function writes directly to the output file.
An object of class PAFit_net
.
A string indicates the file name.
String. Possible values are "edgelist"
and "gml"
.
If format = "edgelist"
, we just output the edgelist matrix contained in the PAFit_net
object as it is.
If format = "gml"
, here is the specification of the gml
file. There is a binary field directed
indicating the type of the network (0
: undirected, 1
: directed). There are three atrributes for an edge: source
, target
, and time
. There are three atrributes for a node: id
, isolated
(binary) and time
. The atrribute time
is NULL
if the attribute isolated
is 0
(since this is not an isolated node, we do not need to record its first apperance time). On the other hand, time
is the node's appearance time if attribute isolated
is 1
.
Thong Pham thongphamthe@gmail.com
library("PAFit")
# a network from Bianconi-Barabasi model
net <- generate_BB(N = 50 , m = 10 , s = 10)
#graph_to_file(net, file_name = "test.gml", format = "gml")
Run the code above in your browser using DataLab