R Under development (unstable) (2024-07-02 r86866 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(ndtv) Loading required package: network 'network' 1.18.2 (2023-12-04), part of the Statnet Project * 'news(package="network")' for changes since last version * 'citation("network")' for citation information * 'https://statnet.org' for help, support, and other information Loading required package: networkDynamic 'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project * 'news(package="networkDynamic")' for changes since last version * 'citation("networkDynamic")' for citation information * 'https://statnet.org' for help, support, and other information Loading required package: animation Loading required package: sna Loading required package: statnet.common Attaching package: 'statnet.common' The following objects are masked from 'package:base': attr, order sna: Tools for Social Network Analysis Version 2.7-2 created on 2023-12-05. copyright (c) 2005, Carter T. Butts, University of California-Irvine For citation information, type citation("sna"). Type help(package="sna") to get started. 'ndtv' 0.13.4 (2024-06-30), part of the Statnet Project * 'news(package="ndtv")' for changes since last version * 'citation("ndtv")' for citation information * 'https://statnet.org' for help, support, and other information > data("short.stergm.sim") > data("toy_epi_sim") > data("windsurfers") > require(testthat) Loading required package: testthat > > compute.animation(short.stergm.sim,slice.par = list(start=0,end=25,interval=1, aggregate.dur=5,rule='latest')) Calculating layout for network slice from time 0 to 5 Calculating layout for network slice from time 1 to 6 Calculating layout for network slice from time 2 to 7 Calculating layout for network slice from time 3 to 8 Calculating layout for network slice from time 4 to 9 Calculating layout for network slice from time 5 to 10 Calculating layout for network slice from time 6 to 11 Calculating layout for network slice from time 7 to 12 Calculating layout for network slice from time 8 to 13 Calculating layout for network slice from time 9 to 14 Calculating layout for network slice from time 10 to 15 Calculating layout for network slice from time 11 to 16 Calculating layout for network slice from time 12 to 17 Calculating layout for network slice from time 13 to 18 Calculating layout for network slice from time 14 to 19 Calculating layout for network slice from time 15 to 20 Calculating layout for network slice from time 16 to 21 Calculating layout for network slice from time 17 to 22 Calculating layout for network slice from time 18 to 23 Calculating layout for network slice from time 19 to 24 Calculating layout for network slice from time 20 to 25 Calculating layout for network slice from time 21 to 26 Calculating layout for network slice from time 22 to 27 Calculating layout for network slice from time 23 to 28 Calculating layout for network slice from time 24 to 29 Calculating layout for network slice from time 25 to 30 > render.animation(short.stergm.sim,edge.col=effectFun('edgeAgeColor',fade.dur=5,start.color = 'red',end.color='blue')) rendering 10 frames for slice 0 rendering 10 frames for slice 1 rendering 10 frames for slice 2 rendering 10 frames for slice 3 rendering 10 frames for slice 4 rendering 10 frames for slice 5 rendering 10 frames for slice 6 rendering 10 frames for slice 7 rendering 10 frames for slice 8 rendering 10 frames for slice 9 rendering 10 frames for slice 10 rendering 10 frames for slice 11 rendering 10 frames for slice 12 rendering 10 frames for slice 13 rendering 10 frames for slice 14 rendering 10 frames for slice 15 rendering 10 frames for slice 16 rendering 10 frames for slice 17 rendering 10 frames for slice 18 rendering 10 frames for slice 19 rendering 10 frames for slice 20 rendering 10 frames for slice 21 rendering 10 frames for slice 22 rendering 10 frames for slice 23 rendering 10 frames for slice 24 rendering 10 frames for slice 25 Warning messages: 1: In min(e) : no non-missing arguments to min; returning Inf 2: In max(e) : no non-missing arguments to max; returning -Inf > > # test function wrapper > effFun<-effectFun('edgeAgeColor',fade.dur=5) > expect_true(is.function(effFun)) > # check argument substitution > expect_equal(names(formals(effFun)),c("net", "onset", "fade.dur", "start.color", "end.color", "na.color" )) > > # check for warning for non matching arg > expect_warning(effectFun('edgeAgeColor',fade.dur=5, foo=6),regexp = 'does not match with any arguments') > > # test for color interpolation > test<-network.initialize(2) > add.edges.active(test,tail=1,head=2,onset=0,terminus=10) > expect_equal(effect.edgeAgeColor(test,start.color = '#00000000',end.color = "#FFFFFFFF",fade.dur=10,onset=5),"#80808080") > > # visual test of edge age coloring > plot(short.stergm.sim,edge.col=effect.edgeAgeColor(short.stergm.sim, + fade.dur=25, + start.color = 'red', + end.color='blue', + onset=24), + edge.label=edges.age.at(short.stergm.sim,24), + edge.lwd=5) > > # visual test of vertex age coloring > plot(windsurfers,vertex.col=effect.vertexAgeColor(windsurfers, + fade.dur=5, + start.color = 'red', + end.color='blue', + onset=11), + label=vertices.age.at(windsurfers,20), + vertex.cex=2) > > proc.time() user system elapsed 4.28 0.34 4.62