R Under development (unstable) (2024-07-03 r86870 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. > # tests for transmission timeline > require(testthat) Loading required package: testthat > require(ndtv) Loading required package: 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 > #require(tsna) > #data(moodyContactSim) > #v10path<-tPath(moodyContactSim,v=10,start=0) > #v11path<-tPath(moodyContactSim,v=11,start=0) > #v12path<-tPath(moodyContactSim,v=12,start=0) > > # creating v10 path via structure for now so don't bring in tsna dep > v10path<-structure(list(tdist = c(583, 494, 634, 40, 712, 701, 224, 719, 674, 0, 749, 621, 453, 665, 709, 575), previous = c(16, 13, 13, 10, 13, 16, 10, 13, 1, 0, 8, 1, 4, 4, 2, 2), gsteps = c(5, 3, 3, 1, 3, 5, 1, 3, 6, 0, 4, 6, 2, 2, 4, 4), start = 0, end = Inf, direction = "fwd", type = "earliest.arrive"), .Names = c("tdist", "previous", "gsteps", "start", "end", "direction", "type"), class = c("tPath", "list")) > > transmissionTimeline(v10path) > transmissionTimeline(v10path,displaylabels = TRUE) > transmissionTimeline(v10path,displaylabels = TRUE,label='a') > transmissionTimeline(v10path,displaylabels = TRUE,label.col='blue') > transmissionTimeline(v10path,displaylabels = TRUE,label.cex=2) > transmissionTimeline(v10path,vertex.col='blue') > transmissionTimeline(v10path,vertex.border='blue') > transmissionTimeline(v10path,vertex.lwd=1:3) > transmissionTimeline(v10path,vertex.sides = c(3,4,50)) > transmissionTimeline(v10path,edge.col='blue') > transmissionTimeline(v10path,edge.lwd=5) > transmissionTimeline(v10path,edge.lty=2) > transmissionTimeline(v10path,xlab='hello',ylab='world',main='diffusion tree timeline plot') > > > > > data("toy_epi_sim") > > expect_error(transmissionTimeline(toy_epi_sim,time.attr='foo'),regexp = 'is not a vertex attribute of the network') > # check for appropriate error if input not a tree > expect_error(transmissionTimeline(toy_epi_sim,time.attr='testatus.active'),regexp = 'network does not appear to be a tree') > > # test for case where no transmissions occur and jitter is active > toy_v50path<-structure(list(tdist = c(Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 0, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf), previous = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), gsteps = c(Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 0, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf ), start = 1, end = Inf, direction = "fwd", type = "earliest.arrive"), .Names = c("tdist", "previous", "gsteps", "start", "end", "direction", "type"), class = c("tPath", "list")) > transmissionTimeline(toy_v50path,jitter=TRUE) > > proc.time() user system elapsed 1.98 0.34 2.32