bind_netifies() concatenates two or more netify objects along
the time axis (for combining cross-sec -> longit, or stacking
two longit panels into a longer one). all inputs must share the
same mode (unipartite / bipartite), symmetry, layers, and
(for cross-sec inputs) the same actor set. actor sets across
periods may differ – the result is a longit_list.
Usage
bind_netifies(
...,
names = NULL,
align_actors = c("none", "union", "intersection")
)Arguments
- ...
two or more netify objects, or a single list of netify objects.
- names
optional character vector to name the resulting periods. if
NULL, periods are auto-named from the inputs' existing period labels (with deduplication if collisions).- align_actors
one of
"none"(default),"union", or"intersection". controls how per-period actor sets are reconciled when inputs differ:"none": keep each period's actor set as supplied; resultinglongit_listperiods may have different dimensions (matches prior behavior)."union": take the union of actor sets across all inputs and pad each period with na rows/columns for actors not originally present."intersection": take the intersection of actor sets across all inputs and subset each period to only those actors.
Details
for combining different layers of the same time slice, use
layer_netify().
this is not the same as layer_netify():
bind_netifies()joins along time.layer_netify()joins along relation (layer).
nodal and dyadic attributes are concatenated per-period; if two inputs supply conflicting values for the same (actor, time), the later input wins (with a one-shot inform).
when downstream models (e.g., tergm cmle) require uniform
actor composition across periods, use align_actors = "union"
or "intersection".
multilayer inputs are supported when each input has the same layer labels.
the result is a longitudinal list whose per-period elements keep the layer
dimension, so as.matrix(x, time = ..., layer = ...),
unnetify(), and decompose_netify() can still address layers.
Examples
# \donttest{
data(icews)
n1 <- netify(icews[icews$year == 2010, ],
actor1 = "i", actor2 = "j", symmetric = FALSE,
weight = "verbCoop")
n2 <- netify(icews[icews$year == 2011, ],
actor1 = "i", actor2 = "j", symmetric = FALSE,
weight = "verbCoop")
combined <- bind_netifies(n1, n2, names = c("2010", "2011"))
summary(combined)
#> net num_actors density num_edges prop_edges_missing mean_edge_weight
#> 1 2010 152 0.4346462 9976 0 41.72113
#> 2 2011 152 0.4229697 9708 0 37.33642
#> sd_edge_weight median_edge_weight min_edge_weight max_edge_weight
#> 1 198.3157 6 1 4937
#> 2 172.2944 5 1 5581
#> competition_row competition_col sd_of_row_means sd_of_col_means
#> 1 0.04071163 0.03493156 41.4412 37.76971
#> 2 0.03964994 0.03405077 35.5239 32.37731
#> covar_of_row_col_means reciprocity mutual transitivity
#> 1 0.9934913 0.9823385 0.8402509 0.6386063
#> 2 0.9903188 0.9763723 0.8327355 0.6220630
# }