R Under development (unstable) (2023-12-09 r85665 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > # Part of the statnet package, http://statnetproject.org > # > # This software is distributed under the GPL-3 license. It is free, > # open source, and has the attribution requirements (GPL Section 7) in > # http://statnetproject.org/attribution > # > # Copyright 2013 the statnet development team > ###################################################################### > > # tests to determine if the networkDynamic class is being set appropriately tested for > > library(networkDynamic) 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 '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 > require(testthat) Loading required package: testthat > #check if activate.edge sets class. > net <- network.initialize(5) > net[1,2] <-1 > nD <-activate.edges(net,onset=0,terminus=1) > if (!is.networkDynamic(nD)){ + stop("activate edges did not set networkDynamic class") + } > nd <- NULL > > net <- network.initialize(5) > net[1,2] <-1 > nD <-activate.vertices(net,onset=0,terminus=1) > if (!is.networkDynamic(nD)){ + stop("activate vertices did not set networkDynamic class") + } > > expect_true(is.networkDynamic(as.networkDynamic(network.initialize(0)))) > > # ----- as.network.networkDynamic ------ > # test removing class > net <- network.initialize(5) > activate.vertices(net,onset=1,terminus=2) > # is networkDynamic class removed > expect_false(is.networkDynamic(as.network(net))) > # is network class retained? > expect_is(net,'network') > > # ----- as.networkDynamic.network ---- > expect_is(as.networkDynamic(network.initialize(2)),'networkDynamic') > > proc.time() user system elapsed 0.96 0.12 1.07