Running 'general.tests.R' [0s]
  Running 'general.tests2.R' [156s]
  Running 'list.attribute.tests.R' [173s]
  Running 'network.access.test.R' [0s]
  Running 'network.battery.R' [165s]
  Running 'pathological.tests.R' [0s]
  Running 'plotflo.R' [143s]
  Running 'speedTests.R' [0s]
  Running 'testthat.R' [4s]
  Running 'vignette.R' [1s]
Running the tests in 'tests/general.tests2.R' failed.
Complete output:
  > #Set to TRUE to run tests
  > if(FALSE){
  + 
  + # additional tests of misc network functionality split off from general.tests.R to avoid speed warnings
  + library(network)
  + 
  + # ----- check memory saftey with a big assignment ---
  + net<-network.initialize(100000)
  + net<-add.edges(net,1:99999,2:100000)
  + set.edge.attribute(net,'LETTERS',LETTERS)
  + 
  + # --- tests for get.induced.subgraph additions --
  + data(emon)
  + # extract the network of responders in MtStHelens network with interaction Frequency of 4
  + subG4<-get.inducedSubgraph(emon$MtStHelens,eid=which(emon$MtStHelens%e%'Frequency'==4))
  + if(network.size(subG4)!=24){
  +   stop('wrong size eid induced subgraph')
  + }
  + 
  + if (any(subG4%e%'Frequency'!=4)){
  +   stop('bad edges in eid induced subgraph')
  + }
  + 
  + # checks for error conditions
  + # can't specify eid with v or alter
  + # get.inducedSubgraph(v=1:2,emon$MtStHelens,eid=which(emon$MtStHelens%e%'Frequency'==4))
  + # get.inducedSubgraph(alter=1:2,emon$MtStHelens,eid=which(emon$MtStHelens%e%'Frequency'==4))
  + # get.inducedSubgraph(emon$MtStHelens,eid=200:300)
  + 
  + 
  + # ---- tests for specific bugs/edgecases -----
  + 
  + # ticket #180 (used to throw error if no edges exist)
  + set.edge.attribute(network.initialize(3),"test","a")
  + 
  + # check for network of zero size --used to give error ticket #255
  + set.vertex.attribute(network.initialize(0),'foo','bar')
  + 
  + 
  + # check for is.na.network problems #619
  + x2<-network.initialize(3)
  + x2[1,2]<-NA
  + if(is.na.network(x2)[1,2]!=1){
  +   stop('problem iwth is.na.netowrk')
  + }
  + 
  + # check for na problems in which.matrix.type #926
  + mat <- matrix(rbinom(200, 1, 0.2), nrow = 20)
  + naIndices <- sample(1:200, 20)
  + mat[naIndices] <- NA
  + nw <- network(mat)
  + 
  + # ---- check for undirected loops getID cases #327 #609 -----
  + net<-network.initialize(2,loops=TRUE,directed=FALSE)
  + net[1,1]<-1
  + net[1,2]<-1
  + net[2,2]<-1
  + if(get.edgeIDs(net,v=1,alter=1)!=1){
  +   stop("problem with get.edgeIDs on undirected network with loops")
  + }
  + if(get.edgeIDs(net,v=2,alter=2)!=3){
  +   stop("problem with get.edgeIDs on undirected network with loops")
  + }
  + 
  + net<-network.initialize(2,loops=TRUE,directed=FALSE)
  + net[1,2]<-1
  + if(length(get.edgeIDs(net,v=2,alter=2))>0){
  +   stop("problem with get.edgeIDs on undirected network with loops")
  + }
  + 
  + # check for problem with as.network.edgelist with zero edges #1138
  + result1 <- as.matrix.network.edgelist(network.initialize(5),as.sna.edgelist = TRUE)
  + if (nrow(result1) != 0){
  +   stop('as.matrix.network.edgelist did not return correct value for net with zero edges')
  + }
  + result1a <- tibble::as_tibble(network.initialize(5))
  + if (nrow(result1a) != 0){
  +   stop('as_tibble.network did not return correct value for net with zero edges')
  + }
  + result2<-as.matrix.network.adjacency(network.initialize(5))
  + if(nrow(result2) != 5 & ncol(result2) != 5){
  +   stop('as.matrix.network.adjacency did not return matrix with correct dimensions')
  + }
  + result3<-as.matrix.network.adjacency(network.initialize(0))
  + if(nrow(result3) != 0 & ncol(result3) != 0){
  +   stop('as.matrix.network.adjacency did not return matrix with correct dimensions')
  + }
  + result4<-as.matrix.network.incidence(network.initialize(5))
  + if(nrow(result4) != 5 & ncol(result4) != 0){
  +   stop('as.matrix.network.incidence did not return matrix with correct dimensions')
  + }
  + result5<-as.matrix.network.incidence(network.initialize(0))
  + if(nrow(result5) != 0 & ncol(result5) != 0){
  +   stop('as.matrix.network.incidence did not return matrix with correct dimensions')
  + }
  + 
  + #End test
  + }
  > 
  > proc.time()
     user  system elapsed 
     0.20    0.04    0.25 
Running the tests in 'tests/list.attribute.tests.R' failed.
Complete output:
  > #Set to TRUE to run tests
  > if(FALSE){
  + 
  + require(network)
  + 
  + # --------- test list.vertex.attributes ---
  + 
  + net<-network.initialize(3)
  + 
  + list.vertex.attributes(net)
  + 
  + if(!all(list.vertex.attributes(net)==c('na','vertex.names'))){
  +   stop('list.vertex.attribute did not report default attributes corrrectly')
  + }
  + 
  + set.vertex.attribute(net,'letters',c("a","b","c"))
  + 
  + if(!all(list.vertex.attributes(net)==c('letters','na','vertex.names'))){
  +   stop('list.vertex.attribute did not report added attributes corrrectly')
  + }
  + 
  + 
  + # ----- test list.edge.attributes ----
  + 
  + net<-network.initialize(3)
  + if(length(list.edge.attributes(net))!=0){
  +   stop("list.edge.attributes did not return empty list for network with no edges")
  + }
  + 
  + add.edges(net,1,2)
  + add.edges(net,2,3)
  + if(list.edge.attributes(net)!='na'){
  +   stop("list.edge.attributes did not return 'na' for network with only edges")
  + }
  + 
  + set.edge.attribute(net,'letter',c("a","b"))
  + if(!all(list.edge.attributes(net)==c('letter','na'))){
  +   stop("list.edge.attributes did not return attribute names for network with edges")
  + }
  +    
  + delete.edges(net,eid=1)   
  + if(!all(list.edge.attributes(net)==c('letter','na'))){
  +    stop("list.edge.attributes did not return attribute names for network deleted edge")
  + }
  +    
  + # ---- test list.network.attributes ----
  + net<-network.initialize(3)   
  + if(!all(list.network.attributes(net)==c("bipartite", "directed",  "hyper","loops","mnext",     "multiple","n" ))){
  +   stop("list.network.attributes returned unexpected values for default attributes of a network")
  + } 
  +    
  + set.network.attribute(net,'letter',"a")   
  +    if(!all(list.network.attributes(net)==c("bipartite", "directed",  "hyper","letter","loops","mnext",     "multiple","n" ))){
  +      stop("list.network.attributes returned unexpected values for network with attribute added")
  +    } 
  + 
  + # ----- tests for printing function for edges cases ------
  + net<-network.initialize(100)
  + net%n%'a_matrix'<-matrix(1:100,nrow=10,ncol=10)
  + net%n%'a_null'<-NULL
  + net%n%'a_list'<-list(part1=list(c("A","B")),part2=list("c"))
  + net%n%'a_desc_vec'<-numeric(rep(100,1))
  + net%n%'a_net'<-network.initialize(5)
  + print.network(net)
  + 
  + #End tests
  + }
  > 
  > proc.time()
     user  system elapsed 
     0.14    0.07    0.20 
Running the tests in 'tests/network.battery.R' failed.
Complete output:
  > #The following battery of tests is intended to verify the functionality of
  > #the network library
  > 
  > #Set to TRUE to run tests
  > if(FALSE){
  + 
  + library(network)
  + #These functions are intended to mimic functionality from the sna package.
  + #Said package is not required to use network, but was used in creating this
  + #battery of tests.
  + rgraph<-function(n){
  +   m<-matrix(rbinom(n*n,1,0.5),n,n)
  +   diag(m)<-0
  +   m
  + }
  + degree<-function(d,cmode = "freeman")
  + {
  +   n <- dim(d)[1]
  +   diag(d) <- NA
  +   switch(cmode, indegree = apply(d, 2, sum, na.rm = TRUE),
  +     outdegree = apply(d, 1, sum, na.rm = TRUE), freeman = apply(d,
  +     2, sum, na.rm = TRUE) + apply(d, 1, sum, na.rm = TRUE))
  + }
  + #gctorture(TRUE)     #Uncomment to perform a more intensive (SLOW) test
  + 
  + # ---- Check assignment, deletion, and adjacency for dyadic graphs ----
  + check<-vector()
  + temp<-network(matrix(0,5,5))
  + temp[1,2]<-1                 #Add edge
  + check[1]<-temp[1,2]==1       #Check adjacency
  + check[2]<-get.network.attribute(temp,"mnext")==2  #Check count
  + temp[1,2]<-1                 #Should have no effect
  + check[3]<-get.network.attribute(temp,"mnext")==2  #Check count
  + temp[1,1]<-1                 #Should have no effect
  + check[4]<-temp[1,1]==0       #Shouldn't be present
  + check[5]<-get.network.attribute(temp,"mnext")==2  #Check count
  + temp[,2]<-1                  #Should add 3 edges
  + check[6]<-get.network.attribute(temp,"mnext")==5  #Check count
  + check[7]<-all(temp[,2]==c(1,0,1,1,1))  #Verify row
  + temp[3:4,3:4]<-1             #Should add 2 edges
  + check[8]<-get.network.attribute(temp,"mnext")==7  #Check count
  + temp[,]<-0                   #Delete edges
  + check[9]<-all(temp[,]==matrix(0,5,5))  #Verify that edges were removed
  + temp[1:2,3:5]<-1             #Add new edges
  + check[10]<-sum(temp[,])==6   #Check edge sum
  + temp<-add.vertices(temp,3)   #Add vertices
  + check[11]<-network.size(temp)==8
  + check[12]<-sum(temp[,])==6   #Edges should still be there
  + check[13]<-all(temp[,5]==c(1,1,0,0,0,0,0,0))
  + temp[8,]<-1                  #Add edges to new vertex
  + check[14]<-all(temp[8,]==c(1,1,1,1,1,1,1,0))  #Verify
  + temp<-delete.vertices(temp,c(7,8))  #Remove vertices
  + check[15]<-network.size(temp)==6  #Verify removal
  + check[16]<-sum(temp[,])==6   #Check edge sum
  + check[17]<-!any(c(7,8)%in%c(sapply(temp$mel,"[[","inl"),sapply(temp$mel,"[[","outl")))  #Make sure they're really gone!
  + temp<-network(matrix(0,5,5),directed=FALSE,loops=TRUE)  #Create undir graph
  + check[18]<-is.directed(temp)==FALSE    #Some simple gal tests
  + check[19]<-has.loops(temp)==TRUE
  + temp[1,]<-1
  + check[20]<-all(temp[,1]==temp[1,])   #Verify edges
  + temp<-permute.vertexIDs(temp,5:1)       #Permute 
  + check[21]<-all(temp[1,]==c(0,0,0,0,1))  #Verify permutation
  + check[22]<-all(temp[,5]==rep(1,5))
  + check[23]<-all(get.neighborhood(temp,1)%in%c(5,1)) #Check neighborhoods
  + check[24]<-all(sort(get.neighborhood(temp,5))==1:5)
  + check[25]<-length(get.edges(temp,5))==5            #Check get.edges
  + check[26]<-length(get.edges(temp,5,2))==1
  + g<-rgraph(10)
  + temp<-network(g)
  + check[27]<-all(g==temp[,])                         #Yet more edge checkage
  + check[28]<-all(g[3:1,-(4:3)]==temp[3:1,-(4:3)])
  + temp[,,,names.eval="newval"]<-matrix(1:100,10,10)  #Edge value assignment
  + check[29]<-all(as.sociomatrix(temp,"newval")==matrix(1:100,10,10)*g)
  + check[30]<-all(apply(as.matrix.network.incidence(temp),1,sum)==(degree(g,cmode="indegree")-degree(g,cmode="outdegree")))  #Check incidence matrix
  + check[31]<-all(dim(as.matrix.network.incidence(temp))==c(10,sum(g)))
  + check[32]<-all(apply(as.matrix.network.incidence(temp,"newval"),1,sum)==(degree(matrix(1:100,10,10)*g,cmode="indegree")-degree(matrix(1:100,10,10)*g,cmode="outdegree")))
  + check[33]<-all(as.matrix.network.edgelist(temp,"newval")==cbind(row(g)[g>0],col(g)[g>0],matrix(1:100,10,10)[g>0]))
  + temp[1:3,1:5,names.eval="newval"]<-matrix(1:15,3,5)
  + check[34]<-all(as.sociomatrix(temp,"newval")[1:3,1:5]==g[1:3,1:5]*matrix(1:15,3,5))
  + temp[,,"na"]<-TRUE                         #Verify NA filtering
  + check[35]<-sum(temp[,,na.omit=TRUE])==0
  + check[36]<-sum(is.na(temp[,,na.omit=FALSE]))==sum(g)
  + 
  + #---- Check assignment, deletion, and adjacency for hypergraphs ----
  + temp<-network.initialize(10,directed=F,hyper=T,loops=T)
  + check[37]<-sum(temp[,])==0
  + temp<-add.edge(temp,1:4,1:4,"value",list(5))
  + temp<-add.edge(temp,3:5,3:5,"value",list(6))
  + temp<-add.edge(temp,4:7,4:7,"value",list(7))
  + temp<-add.edge(temp,6:10,6:10,"value",list(8))
  + check[38]<-all(as.matrix.network.incidence(temp)==cbind(c(1,1,1,1,0,0,0,0,0,0),c(0,0,1,1,1,0,0,0,0,0),c(0,0,0,1,1,1,1,0,0,0),c(0,0,0,0,0,1,1,1,1,1)))
  + check[39]<-all(as.matrix.network.incidence(temp,"value")==cbind(5*c(1,1,1,1,0,0,0,0,0,0),6*c(0,0,1,1,1,0,0,0,0,0),7*c(0,0,0,1,1,1,1,0,0,0),8*c(0,0,0,0,0,1,1,1,1,1)))
  + check[40]<-all(temp[,]==((as.matrix.network.incidence(temp)%*%t(as.matrix.network.incidence(temp)))>0))
  + 
  + #---- Check coercion and construction methods ----
  + g<-rgraph(10)
  + temp<-network(g)
  + check[41]<-all(temp[,]==g)
  + temp<-as.network(g*matrix(1:100,10,10),names.eval="value",ignore.eval=FALSE)
  + check[42]<-all(as.sociomatrix(temp,"value")==g*matrix(1:100,10,10))
  + temp<-as.network.matrix(as.matrix.network.edgelist(temp,"value"),matrix.type="edgelist",names.eval="value",ignore.eval=FALSE)
  + check[43]<-all(as.sociomatrix(temp,"value")==g*matrix(1:100,10,10))
  + temp<-as.network.matrix(as.matrix.network.incidence(temp,"value"),matrix.type="incidence",names.eval="value",ignore.eval=FALSE)
  + check[44]<-all(as.sociomatrix(temp,"value")==g*matrix(1:100,10,10))
  + 
  + # check functioning of na.rm argument #922
  + plain<-as.network.matrix(matrix(c(0,1,NA,NA),ncol=2),na.rm=TRUE)
  + if (network.naedgecount(plain) != 0){
  +   stop('problem with na values in adjacency matrix coericon')
  + }
  + plain<-as.network.matrix(matrix(c(0,1,NA,NA),ncol=2),na.rm=FALSE)
  + if (network.naedgecount(plain) != 1){
  +   stop('problem with na values in adjacnecy matrix coericon')
  + }
  + 
  + 
  + 
  + # test for as.matrix.network edgelist bug #935
  + x <- network.initialize(10)
  + add.edge(x,1,2)
  + add.edge(x,2,3)
  + set.edge.attribute(x,'foo','bar',e=2) # i.e. the edge from 2 to 3
  + if (!identical(as.matrix.network.edgelist(x,'foo'),structure(c("1", "2", "2", "3", NA, "bar"), .Dim = 2:3, n = 10, vnames = 1:10))){
  +   stop("problem with as.matrix.network.edgelist with attribute and deleted edge")
  + }
  + 
  +    
  + 
  + #---- Check attribute assignment/access ----
  + g<-rgraph(10)
  + temp<-network(g)
  + temp<-set.vertex.attribute(temp,"value",1:10)
  + check[45]<-all(get.vertex.attribute(temp,"value")==1:10)
  + temp<-delete.vertex.attribute(temp,"value")
  + check[46]<-all(is.na(get.vertex.attribute(temp,"value")))
  + temp<-set.vertex.attribute(temp,"value",1:5,c(2,4,6,8,10))
  + check[47]<-all(get.vertex.attribute(temp,"value")[c(2,4,6,8,10)]==1:5)
  + temp<-set.network.attribute(temp,"value","pork!")
  + check[48]<-get.network.attribute(temp,"value")=="pork!"
  + temp<-delete.network.attribute(temp,"value")
  + check[49]<-is.null(get.network.attribute(temp,"value"))
  + temp<-set.edge.attribute(temp,"value",5)
  + check[50]<-all(get.edge.attribute(temp$mel,"value")==5)
  + temp<-delete.edge.attribute(temp,"value")
  + check[51]<-all(is.null(get.edge.attribute(temp$mel,"value")))
  + temp<-set.edge.value(temp,"value",g*matrix(1:100,10,10))
  + check[52]<-all(get.edge.value(temp,"value")==(g*matrix(1:100,10,10))[g>0])
  + check[53]<-all(as.sociomatrix(temp,"value")==(g*matrix(1:100,10,10)))
  + 
  + 
  + #---- Check additional operators ----
  + g<-rgraph(10)
  + temp<-network(g,names.eval="value",ignore.eval=FALSE)
  + temp2<-network(g*2,names.eval="value",ignore.eval=FALSE)
  + check[54]<-all(g==as.sociomatrix(temp+temp2))
  + check[55]<-all(g*3==as.sociomatrix(sum(temp,temp2,attrname="value"),"value"))
  + check[56]<-all(g==as.sociomatrix(temp*temp2))
  + check[57]<-all(g*2==as.sociomatrix(prod(temp,temp2,attrname="value"),"value"))
  + check[58]<-all(0==as.sociomatrix(temp-temp2))
  + check[59]<-all(-g==as.sociomatrix(sum(temp,-as.sociomatrix(temp2,"value"),attrname="value"),"value"))
  + check[60]<-all(((g%*%g)>0)==as.sociomatrix("%c%.network"(temp,temp2)))
  + check[61]<-all(((g%*%g)>0)==as.sociomatrix(temp%c%temp2))
  + check[62]<-all(((!temp)[,]==!g)[diag(10)<1])
  + check[63]<-all((temp|temp2)[,]==g)
  + check[64]<-all((temp&temp2)[,]==g)
  + temp%v%"value"<-1:10
  + check[65]<-all(temp%v%"value"==1:10)
  + temp%n%"value"<-"pork!"
  + check[66]<-temp%n%"value"=="pork!"
  + 
  + # ---- Check to ensure that in-place modification is not producing side effects ----
  + g<-network.initialize(5); checkg<-g; add.vertices(g,3)
  + check[67]<-(network.size(checkg)==5)&&(network.size(g)==8)
  + g<-network.initialize(5); checkg<-g; delete.vertices(g,2)
  + check[68]<-(network.size(checkg)==5)&&(network.size(g)==4)
  + g<-network.initialize(5); checkg<-g; add.edge(g,2,3)
  + check[69]<-(sum(checkg[,])==0)&&(sum(g[,])==1)
  + g<-network.initialize(5); checkg<-g; add.edges(g,c(2,2,2),c(1,3,4))
  + check[70]<-(sum(checkg[,])==0)&&(sum(g[,])==3)
  + g<-network.initialize(5); checkg<-g; g%v%"boo"<-1:5
  + check[71]<-all(is.na(checkg%v%"boo"))&&all(g%v%"boo"==1:5)
  + g<-network.initialize(5); checkg<-g; g%n%"boo"<-1:5
  + check[72]<-is.null(checkg%n%"boo")&&all(g%n%"boo"==1:5)
  + g<-network.initialize(5); g[1,]<-1; checkg<-g; g%e%"boo"<-col(matrix(0,5,5))
  + check[73]<-is.null(checkg%e%"boo")&&all(g%e%"boo"==2:5)
  + g<-network.initialize(5); checkg<-g; permute.vertexIDs(g,5:1)
  + check[74]<-all(checkg%v%"vertex.names"==1:5)&&all(g%v%"vertex.names"==5:1)
  + g<-network.initialize(5); temp<-(function(){add.vertices(g,3); network.size(g)})()
  + check[75]<-(network.size(g)==5)&&(temp==8)
  + g<-network.initialize(5); (function(){g<-network.initialize(4); add.vertices(g,3)})()
  + check[76]<-(network.size(g)==5)
  + 
  + # check for operators with undirected edge error ticket #279
  + # nw1 is assigned tail<head
  + nw1<-network.initialize(3,directed=FALSE)
  + nw1[1,2]<-1
  + 
  + # nw2 is assigned tail>head
  + nw2<-network.initialize(3,directed=FALSE)
  + nw2[2,1]<-1
  + 
  + # Which, the binary network operators don't take into account:
  + check[77]<-network.edgecount(nw1-nw2)==0 # Should have 0, has 1.
  + check[78]<-network.edgecount(nw1|nw2)==1 # Should have 1, has 2 (1->2 and 2->1).
  + check[79]<-network.edgecount(nw1&nw2)==1 # Should have 1, has 0 (since it treats 1->2 and 2->1 differently).
  + check[80]<-network.edgecount(!nw1)==2 # Should have choose(3,2)-1=2, has 3.
  + check[81]<-network.edgecount(!nw2)==2 # Should have choose(3,2)-1=2, has 2.
  + 
  + #If everything worked, check is TRUE
  + if(!all(check)){                                               #Should be TRUE
  +   stop(paste("network package test failed on test(s):",which(!check)))
  + }
  + 
  + #End test
  + }
  > 
  > proc.time()
     user  system elapsed 
     0.37    0.03    0.37 
Running the tests in 'tests/plotflo.R' failed.
Complete output:
  > #Set to TRUE to run tests
  > if(FALSE){
  + 
  + #
  + # load the library
  + #
  + library(network)
  + #
  + # attach the sociomatrix for the Florentine marriage data
  + # This is not yet a graph object. 
  + #
  + data(flo)
  + #
  + # print out the sociomatrix for the Florentine marriage data
  + #
  + flo
  + #
  + # Create a network object out of the adjacency matrix and print it out
  + #
  + nflo <- network(flo,directed=FALSE)
  + nflo
  + #
  + # print out the sociomatrix for the Florentine marriage data
  + #
  + print(nflo,matrix.type="adjacency") 
  + #
  + # plot the Florentine marriage data
  + #
  + plot(nflo)
  + #
  + # create a vector indicating the Medici family and add it as a covariate to the
  + # graph object.
  + #
  + nflo <- set.vertex.attribute(nflo,"medici",c(0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0))
  + nflo
  + #
  + # create a vector indicating the Medici family for the graph
  + #
  + medici <- rep("",nrow(flo))
  + names(medici) <- dimnames(flo)[[1]]
  + medici[names(medici)=="Medici"] <- "Medici"
  + #
  + # plot the marriage data, highlighting the Medici family
  + #
  + plot(nflo,vertex.col=1+get.vertex.attribute(nflo,"medici"))
  + 
  + # plot the emon St. Helens network, with edge widths proportional
  + # to 'Frequency', and edges labeled by their id
  + data(emon)
  + par(mar=c(0,0,0,0))
  + plot(emon[[5]],edge.label=TRUE,edge.label.cex=0.6,
  +      edge.col='gray',edge.lwd=(emon[[5]]%e%'Frequency')*2)
  + 
  + #End tests
  + }
  > 
  > proc.time()
     user  system elapsed 
     0.18    0.03    0.20