Running examples in ‘netdiffuseR-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: exposure
> ### Title: Ego exposure
> ### Aliases: exposure
> ### Keywords: univar
> 
> ### ** Examples
> 
> # Calculating lagged exposure -----------------------------------------------
> 
> set.seed(8)
> graph <- rdiffnet(20, 4)
Warning in (function (graph, p, algorithm = "endpoints", both.ends = FALSE,  :
  The option -copy.first- is set to TRUE. In this case, the first graph will be treated as a baseline, and thus, networks after T=1 will be replaced with T-1.
> 
> expo0 <- exposure(graph)
> expo1 <- exposure(graph, lags = 1)
> 
> # These should be equivalent
> stopifnot(all(expo0[, -4] == expo1[, -1])) # No stop!
> 
> 
> # Calculating the exposure based on Structural Equivalence ------------------
> set.seed(113132)
> graph <- rdiffnet(100, 4)
Warning in (function (graph, p, algorithm = "endpoints", both.ends = FALSE,  :
  The option -copy.first- is set to TRUE. In this case, the first graph will be treated as a baseline, and thus, networks after T=1 will be replaced with T-1.
> 
> SE <- lapply(struct_equiv(graph), "[[", "SE")
> SE <- lapply(SE, function(x) {
+    x <- 1/x
+    x[!is.finite(x)] <- 0
+    x
+ })
> 
> 
> # These three lines are equivalent to:
> expo_se2 <- exposure(graph, alt.graph="se", valued=TRUE)
> # Notice that we are setting valued=TRUE, but this is not necesary since when
> # alt.graph = "se" the function checks this to be setted equal to TRUE
> 
> # Weighted Exposure using degree --------------------------------------------
> eDE <- exposure(graph, attrs=dgr(graph))
> 
> # Which is equivalent to
> graph[["deg"]] <- dgr(graph)
> eDE2 <- exposure(graph, attrs="deg")
> 
> # Comparing using incoming edges -------------------------------------------
> eIN <- exposure(graph, outgoing=FALSE)
> 
> # Structral equivalence for different communities ---------------------------
> data(medInnovationsDiffNet)
> 
> # Only using 4 time slides, this is for convenience
> medInnovationsDiffNet <- medInnovationsDiffNet[, , 1:4]
> 
> # METHOD 1: Using the c.diffnet method:
> 
> # Creating subsets by city
> cities <- unique(medInnovationsDiffNet[["city"]])
> 
> diffnet <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == cities[1]]
> diffnet[["expo_se"]] <- exposure(diffnet, alt.graph="se", valued=TRUE)
> 
> for (v in cities[-1]) {
+    diffnet_v <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == v]
+    diffnet_v[["expo_se"]] <- exposure(diffnet_v, alt.graph="se", valued=TRUE)
+    diffnet <- c(diffnet, diffnet_v)
+ }
> 
> # We can set the original order (just in case) of the data
> diffnet <- diffnet[medInnovationsDiffNet$meta$ids]
> diffnet
Dynamic network of class -diffnet-
 Name               : Medical Innovation
 Behavior           : Adoption of Tetracycline
 # of nodes         : 125 (1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, ...)
 # of time periods  : 4 (1 - 4)
 Type               : directed
 Final prevalence   : 1.00
 Static attributes  : city, detail, meet, coll, attend, proage, length, ... (58)
 Dynamic attributes : expo_se (1)
> 
> # Checking everything is equal
> test <- summary(medInnovationsDiffNet, no.print=TRUE) ==
+    summary(diffnet, no.print=TRUE)
> 
> stopifnot(all(test[!is.na(test)]))
> 
> # METHOD 2: Using the 'groupvar' argument
> # Further, we can compare this with using the groupvar
> diffnet[["expo_se2"]] <- exposure(diffnet, alt.graph="se",
+    groupvar="city", valued=TRUE)

 *** caught bus error ***
address (nil), cause 'unknown'

Traceback:
 1: non0.i(x, cld, uniqT = uniqT)
 2: non0ind(e2, getClassDef("dgCMatrix"))
 3: 1/x
 4: 1/x
 5: FUN(X[[i]], ...)
 6: lapply(se, function(x) {    x <- 1/x    x[!is.finite(x)] <- 0    x})
 7: exposure(diffnet, alt.graph = "se", groupvar = "city", valued = TRUE)
An irrecoverable exception occurred. R is aborting now ...
Bus error