Running ‘degree_tests.R’ [8s/10s]
  Running ‘density_tests.R’ [1s/3s]
  Running ‘durations_tests.R’ [1s/1s]
  Running ‘fromDissTests.R’ [1s/2s]
  Running ‘pShift_tests.R’ [1s/1s]
  Running ‘path_tests.R’ [1s/2s]
  Running ‘reachable_tests.R’ [5s/7s]
  Running ‘statsWrapper_tests.R’ [7s/10s]
  Running ‘timeProjectedNetwork_tests.R’ [2s/3s]
Running the tests in ‘tests/statsWrapper_tests.R’ failed.
Complete output:
  > # tests for summary stats functions
  > library(tsna)
  Loading required package: network
  network: Classes for Relational Data
  Version 1.15 created on 2019-04-01.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
                      Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Martina Morris, University of Washington
                      Skye Bender-deMoll, University of Washington
   For citation information, type citation("network").
   Type help("network-package") to get started.
  
  Loading required package: networkDynamic
  
  networkDynamic: version 0.10.0, created on 2019-04-04
  Copyright (c) 2019, Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Skye Bender-deMoll, University of Washington
                      with contributions from
                      Zack Almquist, University of California -- Irvine
                      David R. Hunter, Penn State University
                      Li Wang
                      Kirk Li, University of Washington
                      Steven M. Goodreau, University of Washington
                      Jeffrey Horner
                      Martina Morris, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("networkDynamic").
  
  > require(sna)
  Loading required package: sna
  Loading required package: statnet.common
  
  Attaching package: 'statnet.common'
  
  The following object is masked from 'package:base':
  
      order
  
  sna: Tools for Social Network Analysis
  Version 2.4 created on 2016-07-23.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
   For citation information, type citation("sna").
   Type help(package="sna") to get started.
  
  > require(testthat)
  Loading required package: testthat
  > 
  > # ---- tests for tSnaStats ----
  > 
  > data(nd_test_nets)
  > data(moodyContactSim)
  > 
  > test_that('tSnaStats output as expected',{
  + 
  +   # vertex level measure
  +   output<-tSnaStats(moodyContactSim,'degree')
  +   
  +   expect_true(is.ts(output))
  +   expect_equal(ncol(output),network.size(moodyContactSim))
  +   expect_equal(nrow(output),756)
  +   
  +   # graph level measure
  +   output<-tSnaStats(moodyContactSim,'gden')
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),756)
  +   
  +   # change sampling interval
  +   output<-tSnaStats(moodyContactSim,'gden',time.interval=100)
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),8)
  +   
  +   # check start and end values
  +   expect_equal(attributes(tSnaStats(moodyContactSim,'gden',start=600,time.interval=50))$tsp,c(600.00, 750.00,   0.02))
  +   expect_equal(attributes(tSnaStats(moodyContactSim,'gden',end=600,time.interval=200))$tsp,c(40.000, 440.000,   0.005))
  +   
  +   expect_error(tSnaStats(nd_test_nets[[1]],'degree'),regexp = "must be a object of class 'networkDynamic'")
  +   
  +   # error for non supported function
  +   expect_error(tSnaStats(moodyContactSim,'foo'),regexp = 'not one of the sna package descriptive statistics currently supported')
  +   
  +   # test passing in function args (this would give error if FUN not passed in)
  +   tSnaStats(moodyContactSim,'centralization',FUN='degree',time.interval = 100)
  +   
  +   # test aggregate dur
  +   dyads<-network.dyadcount(moodyContactSim)
  +   expect_equal(as.numeric(tSnaStats(moodyContactSim,'gden',start=0,end=400,time.interval = 100,aggregate.dur=100)),c(1/dyads,0,2/dyads,0,2/dyads))
  +   # this one should miss all the edges
  +   expect_equal(as.numeric(tSnaStats(moodyContactSim,'gden',start=0,end=400,time.interval = 100,aggregate.dur=0)), c(0,0,0,0,0))
  +   
  + })
  > 
  > 
  > 
  > supported_sna_funs <-c('components',
  +                        'triad.census',
  +                        'connectedness',
  +                        'dyad.census',
  +                        'efficiency',
  +                        'gden',
  +                        'hierarchy',
  +                        'lubness',
  +                        'mutuality',
  +                        # 'centralization', leaving off centralization because it requirs additional args
  +                        'closeness',
  +                        'betweenness',
  +                        #'bonpow',   hidden because has singular value problems
  +                        'degree',
  +                        'evcent',
  +                        'flowbet',
  +                        'graphcent',
  +                        'infocent',
  +                        'loadcent',
  +                        'prestige')
  > 
  > 
  > # chec
  > 
  > test_that('all sna stats used by tSnaStats can be called',{
  +   
  +   for (funName in supported_sna_funs){
  +     message('testing ',funName)
  +     tSnaStats(moodyContactSim,funName,start=600,time.interval=50)
  +   }
  +   
  + })
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 1, Total 4
  Node 4, Reach 1, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 1, Total 9
  Node 9, Reach 1, Total 10
  Node 10, Reach 1, Total 11
  Node 11, Reach 1, Total 12
  Node 12, Reach 1, Total 13
  Node 13, Reach 1, Total 14
  Node 14, Reach 1, Total 15
  Node 15, Reach 1, Total 16
  Node 16, Reach 2, Total 18
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 2, Total 5
  Node 4, Reach 1, Total 6
  Node 5, Reach 1, Total 7
  Node 6, Reach 1, Total 8
  Node 7, Reach 1, Total 9
  Node 8, Reach 1, Total 10
  Node 9, Reach 1, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 1, Total 13
  Node 12, Reach 2, Total 15
  Node 13, Reach 2, Total 17
  Node 14, Reach 1, Total 18
  Node 15, Reach 1, Total 19
  Node 16, Reach 1, Total 20
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 1, Total 4
  Node 4, Reach 1, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 1, Total 9
  Node 9, Reach 2, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 1, Total 13
  Node 12, Reach 1, Total 14
  Node 13, Reach 1, Total 15
  Node 14, Reach 1, Total 16
  Node 15, Reach 1, Total 17
  Node 16, Reach 1, Total 18
  Node 1, Reach 1, Total 1
  Node 2, Reach 1, Total 2
  Node 3, Reach 1, Total 3
  Node 4, Reach 2, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 2, Total 10
  Node 9, Reach 1, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 2, Total 14
  Node 12, Reach 1, Total 15
  Node 13, Reach 1, Total 16
  Node 14, Reach 1, Total 17
  Node 15, Reach 1, Total 18
  Node 16, Reach 2, Total 20
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 1, Total 4
  Node 4, Reach 1, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 1, Total 9
  Node 9, Reach 1, Total 10
  Node 10, Reach 1, Total 11
  Node 11, Reach 1, Total 12
  Node 12, Reach 1, Total 13
  Node 13, Reach 1, Total 14
  Node 14, Reach 1, Total 15
  Node 15, Reach 1, Total 16
  Node 16, Reach 2, Total 18
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 2, Total 5
  Node 4, Reach 1, Total 6
  Node 5, Reach 1, Total 7
  Node 6, Reach 1, Total 8
  Node 7, Reach 1, Total 9
  Node 8, Reach 1, Total 10
  Node 9, Reach 1, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 1, Total 13
  Node 12, Reach 2, Total 15
  Node 13, Reach 2, Total 17
  Node 14, Reach 1, Total 18
  Node 15, Reach 1, Total 19
  Node 16, Reach 1, Total 20
  Node 1, Reach 2, Total 2
  Node 2, Reach 1, Total 3
  Node 3, Reach 1, Total 4
  Node 4, Reach 1, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 1, Total 9
  Node 9, Reach 2, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 1, Total 13
  Node 12, Reach 1, Total 14
  Node 13, Reach 1, Total 15
  Node 14, Reach 1, Total 16
  Node 15, Reach 1, Total 17
  Node 16, Reach 1, Total 18
  Node 1, Reach 1, Total 1
  Node 2, Reach 1, Total 2
  Node 3, Reach 1, Total 3
  Node 4, Reach 2, Total 5
  Node 5, Reach 1, Total 6
  Node 6, Reach 1, Total 7
  Node 7, Reach 1, Total 8
  Node 8, Reach 2, Total 10
  Node 9, Reach 1, Total 11
  Node 10, Reach 1, Total 12
  Node 11, Reach 2, Total 14
  Node 12, Reach 1, Total 15
  Node 13, Reach 1, Total 16
  Node 14, Reach 1, Total 17
  Node 15, Reach 1, Total 18
  Node 16, Reach 2, Total 20
  > 
  > 
  > # code below used to find which edge cases cause errors
  > # run tests against all the networkDynamic edge case networks
  > # reports, but does not trigger errors and warnings (because some of them will give errors)
  > # for(n in 1:length(nd_test_nets)){
  > #   for (funName in supported_sna_funs){
  > #       cat('testing net',n,' (',names(nd_test_nets)[n],') with term ',funName, '\n')
  > #       # run in tryCacth block so can report all the errors at once
  > #       tryCatch(
  > #     {
  > #       tSnaStats(nd_test_nets[[n]],funName)
  > #     },
  > #     warning = function(w){
  > #       message("\t",w)
  > #     },
  > #     error = function(e){
  > #       message("\t",e)
  > #     }
  > #       ) # end try catch
  > #      cat("\n")
  > #     }
  > # }
  > 
  > 
  > # ---- tests for tErgmStats ----
  > require(ergm)
  Loading required package: ergm
  
  ergm: version 3.10.1, created on 2019-05-14
  Copyright (c) 2019, Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Carter T. Butts, University of California -- Irvine
                      Steven M. Goodreau, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Martina Morris, University of Washington
                      with contributions from
                      Li Wang
                      Kirk Li, University of Washington
                      Skye Bender-deMoll, University of Washington
                      Chad Klumb
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("ergm").
  
  NOTE: Versions before 3.6.1 had a bug in the implementation of the bd()
  constriant which distorted the sampled distribution somewhat. In
  addition, Sampson's Monks datasets had mislabeled vertices. See the
  NEWS and the documentation for more details.
  
  NOTE: Some common term arguments pertaining to vertex attribute and
  level selection have changed in 3.10.0. See terms help for more
  details. Use 'options(ergm.term=list(version="3.9.4"))' to use old
  behavior.
  
  > 
  > test_that('tSnaStats output as expected',{
  +   
  +   output<-tErgmStats(moodyContactSim,'~edges')
  +   
  +   expect_true(is.ts(output))
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),756)
  +   
  +  
  +   output<-tErgmStats(moodyContactSim,'~degree(0:3)')
  +   expect_equal(ncol(output),4)
  +   expect_equal(nrow(output),756)
  +   
  +   # change sampling interval
  +   output<-tErgmStats(moodyContactSim,'~edges',time.interval=100)
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),8)
  +   
  +   # check start and end values
  +   expect_equal(attributes(tErgmStats(moodyContactSim,'~edges',start=600,time.interval=50))$tsp,c(600.00, 750.00,   0.02))
  +   expect_equal(attributes(tErgmStats(moodyContactSim,'~edges',end=600,time.interval=200))$tsp,c(40.000, 440.000,   0.005))
  +   
  +   expect_error(tErgmStats(nd_test_nets[[1]],'edges'),regexp = "must be a object of class 'networkDynamic'")
  +   
  +   expect_error(tErgmStats(as.networkDynamic(network.initialize(3,hyper=TRUE)),'edges'),regexp = "not appropriate for hypergraphic networks")
  +   
  +   expect_error(tErgmStats(as.networkDynamic(network.initialize(3,multi=TRUE)),'edges'),regexp = "not appropriate for multiplex networks")
  +   
  +   # check that it will add '~' in front if ommited
  +   tErgmStats(moodyContactSim,'edges',time.interval=200)
  +   
  +   # error for non supported function
  +   expect_error(tErgmStats(moodyContactSim,'foo'),regexp = 'initialization function .+ not found.')
  +   
  +   # test aggregate dur
  +   expect_equal(as.numeric(tErgmStats(moodyContactSim,'edges',time.interval = 100)),c(1,0,2,0,0,0,2,1))
  +   expect_equal(as.numeric(tErgmStats(moodyContactSim,'edges',time.interval = 100,aggregate.dur=100)),c(1,2,2,0,2,4,8,4))
  +   
  + })
  Error: Test failed: 'tSnaStats output as expected'
  * 'summary.statistics.formula' is not an exported object from 'namespace:ergm'
  1: tErgmStats(moodyContactSim, "~edges")
  2: lapply(times, function(t) {
         if (aggregate.dur == 0) {
             net <- network.collapse(nd, at = t)
         }
         else {
             net <- network.collapse(nd, onset = t, length = aggregate.dur)
         }
         ergm::summary.statistics.formula(as.formula(paste("net", formula)))
     })
  3: FUN(X[[i]], ...)
  4: ergm::summary.statistics.formula
  5: getExportedValue(pkg, name)
  6: stop(gettextf("'%s' is not an exported object from 'namespace:%s'", name, getNamespaceName(ns)), 
         call. = FALSE, domain = NA)
  Execution halted