Learn R Programming

networkDynamic (version 0.4.1)

as.data.frame.networkDynamic: Extracts the edge timing information from a networkDynamic object and represent as a data.frame.

Description

Creates a data.frame giving lists of edges and their activity spells corresponding to the networkDynamic object.

Usage

## S3 method for class 'networkDynamic':
as.data.frame(x, row.names = NULL, optional = FALSE,
                                       e =seq_along(x$mel),
                                       start = NULL, end = NULL, active.default=TRUE,...)

Arguments

x
a networkDynamic object
row.names
ignored
optional
ignored
e
vector of edge ids that should be included in the output.
start
Left-censoring time: time at which the network was first observed. Edge spells with onset -Inf are given this as their start time (and marked as left censored). See Details for the default values.
end
Right-censoring time: time at which the network was last observed. Edge spells with terminus Inf are given this as their end time (and marked as right censored). See Details for the default values.
active.default
logical indicating if edges with no defined a ctivity spells should be considered active by default (and appear as a row in output)
...
possible additional arguments

Value

  • A data.frame containing timed relational information describing the networkDynamic object, having the following columns:
  • onset, terminusOnset and terminus times of an edge, respectively, if not censored, and left and right censoring times, if censored.
  • tail, headTail and head of the edge.
  • onset.censored, terminus.censoredTRUE if onset/terminus time is censored.
  • durationthe duration (terminus-onset) of each spell, evaluated after censoring
  • edge.idthe id of the edge the row corresponds to
  • The output data.frame will be sorted by edge.id, onset,terminus. This means that for most (non-multiplex) networks the group of spells for a specific edge will appear in sequential lines of output, but the overall output is not in a temporal order.

Details

Represents the edge dynamics of a networkDynamic object as a data frame giving lists of edges and their activity spells, including whether an activity spell was "censored". If x has attr-style attribute "start", it will be used as the left-censoring time and similarly for "end" and right-censoring time.

See Also

See Also as get.edge.activity,get.vertex.activity

Examples

Run this code
net <-network.initialize(3)
net[1,2]<-1;
net[2,3]<-1;
## censoring
activate.edges(net,onset=1,terminus=Inf,e=1)
activate.edges(net,onset=2,terminus=3,e=2)
activate.vertices(net, onset=1, terminus=Inf, v=1)
as.data.frame(net)

Run the code above in your browser using DataLab