Coming from R networkDynamic
DynamicNetworks.jl follows the activity semantics of R's networkDynamic (0.12): half-open spells [onset, terminus), point spells [t, t) active exactly at t, elements with no spells active by default (active.default = TRUE), and spells merged on activation. This page maps the R functions to their Julia counterparts and marks every difference in signature or meaning.
How the agreement is checked
The test suite replays a golden fixture generated by R: test/fixtures/spell_semantics.toml, written by test/fixtures/r/spell_semantics.R (regenerate with Rscript test/fixtures/r/spell_semantics.R > test/fixtures/spell_semantics.toml). It holds 80 random cases on five-vertex directed and undirected networks: activation and deactivation sequences with point, adjacent and overlapping spells, plus vertices and edges that never receive a spell. For each case the Julia result must equal R's exactly for
- the stored spells of every vertex and edge (
get.vertex.activity/get.edge.activity), network.extractat instants and over intervals (rule = "any"and"all"): the active vertex set and the edge set,network.collapseover intervals (the edge set; see the vertex difference below),reconcile.edge.activity(mode = "reduce.to.vertices").
A second fixture, test/fixtures/panel_semantics.toml (written by test/fixtures/r/panel_semantics.R), holds 40 random panels of two to four networks on 5–18 vertices, directed and undirected, with R's default panel spells, shifted ones (start =) and explicit ones with gaps and point spells. The panel constructor must reproduce networkDynamic(network.list = ...) exactly: every vertex's and every dyad's stored spells and the range of net.obs.period.
Functions not listed in these fixtures are ports by reading R's documentation and source, not validated against R output.
Every export of networkDynamic 0.12 has a row below (— in the Julia column means it has no counterpart).
Concordance
| R networkDynamic | DynamicNetworks.jl | Differences |
|---|---|---|
networkDynamic(base.net, edge.spells=, vertex.spells=) | DynamicNetwork(n; directed, observation_start, observation_end) then activate!/activate_edges! | No constructor from spell data frames. |
networkDynamic(network.list =, onsets =, termini =, start =) | DynamicNetwork(networks; onsets, termini, start), as_dynamic_network(networks; ..., report) | Same discrete spells, merging and default spells (start + 0:K-1, length 1). Panels are matched by vertex position and must have the same size, directedness, loops and two-mode partition (vertex.pid matching is not implemented). One observation window (min onset, max terminus) instead of one observation spell per panel. Static attributes come from the first panel (base.net); create.TEAs is not implemented. |
as.networkDynamic(net) (as.networkDynamic.network) | as_dynamic_network(net; onset, terminus) | Julia gives every vertex and edge the spell [onset, terminus) and sets the observation window; R leaves them without spells (active by default). |
as.networkDynamic.networkDynamic | — | Identity in R; a DynamicNetwork needs no conversion. |
as.network.networkDynamic | dnet.network | The base network, as R's method strips the dynamic class; spells are dropped. For a time-aware static network use network_extract/network_collapse. |
is.networkDynamic | dnet isa DynamicNetwork | — |
print.networkDynamic | show(dnet) | Prints the size, the observation window (or "none set") and the spell counts. |
activate.vertices, activate.edges | activate!(dnet, onset, terminus; vertex=)/(; edge=), activate_vertices!, activate_edges!, add_spell! | Same merging. One spell per call (R vectorises over onsets). add_spell!(...; merge=false) keeps spells unmerged (no R equivalent). Unknown vertices and impossible edges are ArgumentErrors. |
add.edges.active | activate!(dnet, onset, terminus; edge=(i, j)), activate_edges! | Activating an edge that is not in the base network adds it, so no separate function is needed. |
add.vertices.active | — | Not implemented: add the vertices to dnet.network (add_vertices!), then activate! them. |
add.edge.networkDynamic, add.edges.networkDynamic, add.vertices.networkDynamic | add_edge!(dnet.network, i, j), add_vertices!(dnet.network, k) | R's methods keep the dynamic class; here the base network is a field. An added element has no spell record, so it is active by default. |
delete.edge.activity, delete.vertex.activity | — | Not implemented. They remove an element's activity record, which makes it active by default again; deactivate!(dnet, -Inf, Inf; ...) makes it never active instead, and remove_spell! removes one stored spell. |
deactivate.vertices, deactivate.edges | deactivate! | Same, including elements with no spells (cut out of (-Inf, Inf)). A point interval [t, t) removes only point spells at t (not compared against R). |
is.active(x, at=, onset=, terminus=, v=/e=, rule=, active.default=) | is_active(dnet, at; vertex=/edge=, active_default), is_active(dnet, onset, terminus; rule, ...) | One element per call. Rules "earliest"/"latest" not implemented. |
get.vertex.activity, get.edge.activity | get_vertex_activity(dnet, v), get_edge_activity(dnet, i, j) | One element per call; as.spellList not implemented. An element with no spells is reported as (-Inf, Inf) under active_default=true, as in R. |
| — | get_spells, when_vertex, when_edge | Julia-only: the stored spells (empty for an element with no record). Not R names; R's when.vertex.attrs.match is a different function. |
get.edges.active(x, v, alter, at=, onset=, terminus=) | active_edges(dnet, at) | Partial: active_edges lists every active edge of the network; filter it for the edges at v (or alter). No interval form. |
get.edge.value.active | get_edge_attribute_active | One edge per call. |
when.vertex.attrs.match, when.edge.attrs.match | — | Not implemented. |
get.change.times | get_change_times | Network-attribute activity does not exist here. |
net.obs.period | get_observation_period, set_observation_period! | One observation spell. When none is set, get_observation_period returns nothing, as nd %n% "net.obs.period" is NULL; nothing is derived from the data. TSNA.jl and NDTV.jl then apply tsna's and ndtv's own rules for a network without a window. |
network.extract(x, at=/onset=, terminus=, rule=, retain.all.vertices=) | network_extract(dnet, at; ...), network_extract(dnet, onset, terminus; rule, retain_all_vertices, active_default) | trim.spells and length= not implemented. The R vertex.pid becomes the :vertex_pid vertex attribute when vertices are renumbered. |
network.collapse(dnet, onset=, terminus=, rule=) | network_collapse(dnet; onset, terminus, rule, active_default) | Keeps every vertex (stable IDs; R drops inactive vertices); edges agree with R. No activity.count/activity.duration edge attributes and no TEA aggregation. For at=, use network_extract. |
get.networks(x, start, end, time.increment) | network_slice(dnet, times) | Takes the instants explicitly. |
reconcile.edge.activity(mode = "reduce.to.vertices") | reconcile_activity! | Mode "match.to.vertices" not implemented. |
activate.vertex.attribute, get.vertex.attribute.active | set_vertex_attribute_active!, get_vertex_attribute_active | One value per call; when attribute spells overlap, the most recently set value is returned. return.tea/rule not implemented. |
activate.edge.attribute, get.edge.attribute.active | set_edge_attribute_active!, get_edge_attribute_active | As for vertices. |
activate.edge.value | — | Not implemented (it sets an edge attribute from a matrix); call set_edge_attribute_active! per edge. |
list.vertex.attributes.active, list.edge.attributes.active | list_vertex_attributes_active, list_edge_attributes_active | — |
list.network.attributes.active, deactivate.network.attribute | — | Not implemented (no time-varying network attributes). |
spells.overlap | spell_overlap | Takes Spell values. |
| — | spell_duration, DynamicNetworks.unbounded_spell | Julia-only. An unbounded spell (±Inf, or typemin/typemax on integer and calendar axes) has unbounded duration (Inf, typemax, ...), never an overflowed subtraction. |
get.vertex.pid, get.edge.id, vertex.pid.check, edge.pid.check | — | Not implemented: persistent IDs exist only as the :vertex_pid attribute of extracted networks. |
network.size.active, network.edgecount.active | length(active_vertices(dnet, t)), length(active_edges(dnet, t)) | No dedicated functions; active_edges does not check the endpoints (R's network.edgecount.active does not either). |
Not implemented
R functions and options with no DynamicNetworks.jl counterpart (each is also listed in the README and the CHANGELOG "Known limitations"):
- time-varying network attributes (
activate.network.attribute,get.network.attribute.active, ...) and attribute deactivation (deactivate.vertex.attribute,deactivate.edge.attribute); network.collapseattribute aggregation (activity.count,activity.duration, TEA summaries) andrule = "earliest"/"latest"anywhere;trim.spellsin extraction,reconcile.edge.activity(mode = "match.to.vertices"),reconcile.vertex.activity;- data-frame import/export of spells (
networkDynamic(edge.spells=, vertex.spells=),as.data.frame.networkDynamic),read.son; - persistent IDs beyond
:vertex_pid(vertex.pid/edge.pidmanagement,get.vertex.id,get.vertex.pid,get.edge.id,get.edge.pid,initialize.pids,vertex.pid.check,edge.pid.check), hence panels with different vertex sets; net.obs.periodwith several observation spells,mode/time.unit/time.incrementmetadata;- active-subset helpers
get.edgeIDs.active,get.edges.active(beyondactive_edges),get.neighborhood.active,is.adjacent.active,get.dyads.active,network.dyadcount.active,network.naedgecount.active,add.vertices.active, the age functions (edges.age.at,dyads.age.at,vertices.age.at),adjust.activity,delete.edge.activity/delete.vertex.activity,network.dynamic.check,search.spell,spells.hit,when.vertex.attrs.match/when.edge.attrs.match,activate.edge.valueand the%t%/%k%operators; - hyperedges and multiplex (parallel) edges, which NetworkCore.jl does not represent.