@@ -164,27 +164,27 @@ b7 = get.edgeIDs.active(anet, iov[5,1], at=10, active.default=F)==5 # at a
164164b8 = get.edgeIDs.active(anet , iov [7 ,1 ], at = 30 , active.default = F )== 7 # at b
165165
166166# interval queries that should return empty vectors
167- b9 = length(get.edgeIDs.active(anet , iov [3 ,1 ], Inf , Inf , active.default = F ))== 0 # over (Inf,Inf)
168- b10 = length(get.edgeIDs.active(anet , iov [8 ,1 ], - Inf , Inf , active.default = F ))== 0 # over (-Inf,Inf)
169- b11 = length(get.edgeIDs.active(anet , iov [3 ,1 ], 30 , Inf , active.default = F ))== 0 # over (H,Inf)
170- b12 = length(get.edgeIDs.active(anet , iov [4 ,1 ], - Inf , 0 , active.default = F ))== 0 # over (-Inf, L)
171- b13 = length(get.edgeIDs.active(anet , iov [5 ,1 ], 0 , 5 , active.default = F ))== 0 # over (L1,L2)
172- b14 = length(get.edgeIDs.active(anet , iov [5 ,1 ], 0 , 15 , active.default = F , rule = " all" ))== 0 # over (L,M)
173- b15 = length(get.edgeIDs.active(anet , iov [7 ,1 ], 0 , 60 , active.default = F , rule = " all" ))== 0 # over (L,H)
174- b16 = length(get.edgeIDs.active(anet , iov [7 ,1 ], 45 , 55 , active.default = F , rule = " all" ))== 0 # over (M, H)
175- b17 = length(get.edgeIDs.active(anet , iov [6 ,1 ], 15 , 20 , active.default = F ))== 0 # over (H1, H2)
167+ b9 = length(get.edgeIDs.active(anet , iov [3 ,1 ], onset = Inf , terminus = Inf , active.default = F ))== 0 # over (Inf,Inf)
168+ b10 = length(get.edgeIDs.active(anet , iov [8 ,1 ], onset = - Inf , terminus = Inf , active.default = F ))== 0 # over (-Inf,Inf)
169+ b11 = length(get.edgeIDs.active(anet , iov [3 ,1 ], onset = 30 , terminus = Inf , active.default = F ))== 0 # over (H,Inf)
170+ b12 = length(get.edgeIDs.active(anet , iov [4 ,1 ], onset = - Inf , terminus = 0 , active.default = F ))== 0 # over (-Inf, L)
171+ b13 = length(get.edgeIDs.active(anet , iov [5 ,1 ], onset = 0 , terminus = 5 , active.default = F ))== 0 # over (L1,L2)
172+ b14 = length(get.edgeIDs.active(anet , iov [5 ,1 ], onset = 0 , terminus = 15 , active.default = F , rule = " all" ))== 0 # over (L,M)
173+ b15 = length(get.edgeIDs.active(anet , iov [7 ,1 ], onset = 0 , terminus = 60 , active.default = F , rule = " all" ))== 0 # over (L,H)
174+ b16 = length(get.edgeIDs.active(anet , iov [7 ,1 ], onset = 45 , terminus = 55 , active.default = F , rule = " all" ))== 0 # over (M, H)
175+ b17 = length(get.edgeIDs.active(anet , iov [6 ,1 ], onset = 15 , terminus = 20 , active.default = F ))== 0 # over (H1, H2)
176176
177177# interval queries that should return non-empty vectors
178- b18 = min(get.edgeIDs.active(anet , iov [1 ,1 ], - Inf , Inf , active.default = T ))== 1 # over null
179- b19 = get.edgeIDs.active(anet , iov [2 ,1 ], - Inf , Inf , active.default = F )== 2 # over (-Inf,Inf)
180- b20 = get.edgeIDs.active(anet , iov [4 ,1 ], 10 , Inf , active.default = F )== 4 # over (a,Inf)
181- b21 = get.edgeIDs.active(anet , iov [3 ,1 ], - Inf , 20 , active.default = F )== 3 # over (-Inf, b)
182- b22 = get.edgeIDs.active(anet , iov [5 ,1 ], 10 , 20 , active.default = F )== 5 # over (a,b)
183- b23 = get.edgeIDs.active(anet , iov [6 ,1 ], 10 , 10 , active.default = F )== 6 # over (a,a)
184- b24 = get.edgeIDs.active(anet , iov [4 ,1 ], 0 , 15 , active.default = F )== 4 # over (L,M)
185- b25 = get.edgeIDs.active(anet , iov [7 ,1 ], 0 , 60 , active.default = F )== 7 # over (L,H)
186- b26 = get.edgeIDs.active(anet , iov [5 ,1 ], 15 , 18 , active.default = F )== 5 # over (M1, M2)
187- b27 = get.edgeIDs.active(anet , iov [7 ,1 ], 45 , 60 , active.default = F )== 7 # over (M, H)
178+ b18 = min(get.edgeIDs.active(anet , iov [1 ,1 ], onset = - Inf , terminus = Inf , active.default = T ))== 1 # over null
179+ b19 = get.edgeIDs.active(anet , iov [2 ,1 ], onset = - Inf , terminus = Inf , active.default = F )== 2 # over (-Inf,Inf)
180+ b20 = get.edgeIDs.active(anet , iov [4 ,1 ], onset = 10 , terminus = Inf , active.default = F )== 4 # over (a,Inf)
181+ b21 = get.edgeIDs.active(anet , iov [3 ,1 ], onset = - Inf , terminus = 20 , active.default = F )== 3 # over (-Inf, b)
182+ b22 = get.edgeIDs.active(anet , iov [5 ,1 ], onset = 10 , terminus = 20 , active.default = F )== 5 # over (a,b)
183+ b23 = get.edgeIDs.active(anet , iov [6 ,1 ], onset = 10 , terminus = 10 , active.default = F )== 6 # over (a,a)
184+ b24 = get.edgeIDs.active(anet , iov [4 ,1 ], onset = 0 , terminus = 15 , active.default = F )== 4 # over (L,M)
185+ b25 = get.edgeIDs.active(anet , iov [7 ,1 ], onset = 0 , terminus = 60 , active.default = F )== 7 # over (L,H)
186+ b26 = get.edgeIDs.active(anet , iov [5 ,1 ], onset = 15 , terminus = 18 , active.default = F )== 5 # over (M1, M2)
187+ b27 = get.edgeIDs.active(anet , iov [7 ,1 ], onset = 45 , terminus = 60 , active.default = F )== 7 # over (M, H)
188188
189189b.tests = paste(" b" , seq(1 ,27 ), sep = " " )
190190b.results = sapply(b.tests , function (x ){eval(parse(text = x ))})
@@ -278,7 +278,7 @@ net1 <- network(flo, directed=FALSE)
278278el1 <- as.matrix(net1 , matrix.type = " edgelist" )
279279activate.edges(net1 , 10 , 20 , e = seq(2 ,20 ,2 ))
280280activate.edges(net1 , 10 , 10 , e = seq(1 ,19 ,2 ))
281- n1 = get.neighborhood.active(net1 , v = 9 , 10 , 20 , rule = " all" )
281+ n1 = get.neighborhood.active(net1 , v = 9 , onset = 10 , terminus = 20 , rule = " all" )
282282n2 = get.neighborhood.active(net1 , v = 9 , at = 10 )
283283b1 = all(n1 == c(2 ,3 ,13 ,16 ))
284284b2 = all(n2 == c(1 ,2 ,3 ,13 ,14 ,16 ))
@@ -295,37 +295,37 @@ net2 <- network(flo)
295295el2 <- as.matrix(net2 , matrix.type = " edgelist" )
296296activate.edges(net2 , - Inf , 20 , e = seq(2 ,40 ,2 ))
297297activate.edges(net2 , 20 , 20 , e = seq(1 ,39 ,2 ))
298- n4 = get.neighborhood.active(net2 , v = 15 , 10 , 20 , type = " out" )
298+ n4 = get.neighborhood.active(net2 , v = 15 , onset = 10 , terminus = 20 , type = " out" )
299299n5 = get.neighborhood.active(net2 , v = 15 , at = 20 , type = " out" )
300300b4 = all(n4 == c(5 ,11 ,13 ))
301301b5 = (n5 == 4 )
302302
303303# branch 5: directed network, no out neighborhood
304- n6 = get.neighborhood.active(net2 , v = 1 , 10 , 20 , type = " out" )
305- n7 = get.neighborhood.active(net2 , v = 15 , 30 , 40 , type = " out" )
304+ n6 = get.neighborhood.active(net2 , v = 1 , onset = 10 , terminus = 20 , type = " out" )
305+ n7 = get.neighborhood.active(net2 , v = 15 , onset = 30 , terminus = 40 , type = " out" )
306306b6 = length(n6 )== 0
307307b7 = length(n7 )== 0
308308
309309# branch 6: directed network, in neighborhood
310310net3 <- network(flo )
311311activate.edges(net3 , 10 , Inf , e = seq(2 ,40 ,2 ))
312312activate.edges(net3 , 10 , 20 , e = seq(1 ,39 ,2 ))
313- n8 = get.neighborhood.active(net3 , v = 9 , 10 , 20 , type = " in" )
314- n9 = get.neighborhood.active(net3 , v = 9 , 10 , 30 , type = " in" , rule = " all" )
313+ n8 = get.neighborhood.active(net3 , v = 9 , onset = 10 , terminus = 20 , type = " in" )
314+ n9 = get.neighborhood.active(net3 , v = 9 , onset = 10 , terminus = 30 , type = " in" , rule = " all" )
315315b8 = all(n8 == c(1 ,2 ,3 ,13 ,14 ,16 ))
316316b9 = all(n9 == c(2 ,13 ,16 ))
317317
318318# branch 7: directed network, no in neighborhood
319- n10 = get.neighborhood.active(net3 , v = 12 , 10 , 20 , type = " in" )
320- n11 = get.neighborhood.active(net3 , v = 9 , - 10 , - 5 , type = " in" )
319+ n10 = get.neighborhood.active(net3 , v = 12 , onset = 10 , terminus = 20 , type = " in" )
320+ n11 = get.neighborhood.active(net3 , v = 9 , onset = - 10 , terminus = - 5 , type = " in" )
321321b10 = length(n10 )== 0
322322b11 = length(n11 )== 0
323323
324324# branch 8: directed network, combined neighborhood, having in and out ties
325325net4 <- network(flo )
326326activate.edges(net4 , at = 10 , e = seq(2 ,40 ,2 ))
327327activate.edges(net4 , at = 20 , e = seq(1 ,39 ,2 ))
328- n12 = get.neighborhood.active(net4 , v = 7 , 10 , 30 , type = " combined" )
328+ n12 = get.neighborhood.active(net4 , v = 7 , onset = 10 , terminus = 30 , type = " combined" )
329329n13 = get.neighborhood.active(net4 , v = 7 , at = 20 , type = " combined" )
330330b12 = all(n12 == c(2 ,4 ,8 ,16 ))
331331b13 = all(n13 == c(2 ,4 ,16 ))
@@ -335,8 +335,8 @@ net5 <- network(flo)
335335net5 [15 ,] = 0 # remove all out edges from node 15
336336el5 <- as.matrix(net5 , matrix.type = " edgelist" )
337337activate.edges(net5 , e = seq(2 ,36 ,2 ))
338- n14 = get.neighborhood.active(net5 , v = 15 , - Inf , Inf , type = " combined" )
339- n15 = get.neighborhood.active(net5 , v = 15 , - Inf , Inf , type = " combined" , active.default = F )
338+ n14 = get.neighborhood.active(net5 , v = 15 , onset = - Inf , terminus = Inf , type = " combined" )
339+ n15 = get.neighborhood.active(net5 , v = 15 , onset = - Inf , terminus = Inf , type = " combined" , active.default = F )
340340b14 = all(n14 == c(4 ,5 ,11 ,13 ))
341341b15 = all(n15 == c(4 ,11 ))
342342
0 commit comments