Problem Description:
I am attempting to perform temporal network analysis using R, specifically utilizing the temporal network tools provided by statnet: networkDynamic and ndtv. The purpose is to observe the changes that occur in a network over time. However, I am facing an error when trying to execute the networkDynamic function.
Here is the relevant information:
language R
version.string R version 4.3.1 (2023-06-16 ucrt) nickname Beagle Scouts System
Data:
test_spells <- data.frame(
onset = c(58, 65, 74, 77, 52, 55, 57, 1, 6, 17, 20, 22, 46, 74, 52, 57, 58, 84, 60, 71, 61),
terminus = c(63, 66, 74, 77, 52, 55, 60, 4, 15, 18, 20, 44, 67, 78, 54, 58, 62, 84, 63, 71, 61),
idTail = c(248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 29, 29, 29, 29, 29, 29, 29),
idHead = c(28, 28, 28, 28, 29, 29, 29, 76, 76, 76, 76, 76, 76, 76, 248, 248, 28, 28, 3, 3, 56)
)
test_el <- data.frame(
idTail = c(29, 29, 29, 29, 248, 248, 248),
idHead = c(3, 28, 56, 248, 28, 29, 76),
weight = c(2, 2, 1, 2, 4, 3, 7),
edge.id = c(1, 2, 3, 4, 5, 6, 7)
)
Code:
net <- network(x = test_el)
net_dyn <- networkDynamic(base.net = net, edge.spells = test_spells)
Error Message:
Error in networkDynamic(base.net = net, edge.spells = test_spells) : base.net network size is smaller than size implied by vertex.ids in vertex or edge argument
Network plot
plot.network(net,label = network.vertex.names(net))
Could someone please help me understand why I am getting this error message and how to resolve this issue? Thank you in advance!