
This function converts a graph stored in an edgelist matrix format to a PAFit_net
object.
as.PAFit_net(graph, type = "directed", PA = NULL, fitness = NULL)
An object of class PAFit_net
An edgelist matrix. Each row is assumed to be of the form (from_node_id
to_node_id
time_stamp
). For a directed network ,from_node_id
is the id of the source node and to_node_id
is the id of the destination node. For an undirected network, the order is ignored and from_node_id
and to_node_id
are the ids of two ends. time_stamp
is the arrival time of the edge. from_node_id
and to_node_id
are assumed to be integers that are at least
To register a new node i -1 t
). This works for both undirected and directed networks.
time_stamp
can be either numeric or string. The value of a time-stamp can be arbitrary, but we assume that a smaller time_stamp (regarded so by the sort
function in R
) represents an earlier arrival time. Examples of time-stamps that satisfy this assumption are the integer 0:T
, the string format `yyyy-mm-dd', and the POSIX time.
String. Indicates whether the network is "directed"
or "undirected"
.
Numeric vector. Contains the PA function. Default value is NULL
.
Numeric vector. Contains node fitnesses. Default value is NULL
.
Thong Pham thongphamthe@gmail.com
library("PAFit")
# a network from Bianconi-Barabasi model
net <- generate_BB(N = 50 , m = 10 , s = 10)
as.PAFit_net(net$graph)
Run the code above in your browser using DataLab