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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: contagion
> ### Title: Contagion Simulations
> ### Aliases: contagion
> 
> ### ** Examples
> 
> # Loads simulated banking data
> data("sim_data")
> head(sim_data)
  bank     assets liabilities   buffer   weights
1   b1 0.37490927   9.6317127 5.628295 17.119551
2   b2 0.66805904   0.7126552 2.847072  6.004475
3   b3 0.79064804   0.3089983 3.983451  6.777531
4   b4 0.02420156   0.6562193 5.657779  7.787618
5   b5 0.65294261   0.9153901 4.446595  8.673730
6   b6 0.60766835   0.3007373 2.252369  4.708805
> 
> # seed for reproducibility
> set.seed(15)
> 
> # minimum density estimation
> # verbose = F to prevent printing
> md_mat <- matrix_estimation(sim_data$assets, sim_data$liabilities, method = "md", verbose = FALSE)
> 
> # rownames and colnames for the matrix
> rownames(md_mat) <- colnames(md_mat) <- sim_data$bank
> 
> # DebtRank simulation
> contdr <- contagion(exposures = md_mat, buffer = sim_data$buffer, weights = sim_data$weights, 
+                     shock = "all", method = "debtrank", verbose = FALSE)
> summary(contdr)
Contagion Simulations Summary

Info:
 Propagation Function: debtrank 
 With parameters: 
data frame with 0 columns and 0 rows

Simulation summary (showing 10 of 125 -- decreasing order of additional stress):
 Scenario Original Stress Additional Stress Original Losses Additional Losses
      b55          0.1102              0.29           58.44               235
      b28          0.0638              0.20           63.45               117
      b74          0.0161              0.15           14.37                48
      b84          0.0236              0.13            7.61                72
      b33          0.0243              0.12           27.44                46
       b5          0.0038              0.12            4.45                27
     b101          0.0070              0.11            9.31                25
      b60          0.0057              0.11            0.67                26
      b23          0.0032              0.11            5.39                22
     b114          0.0055              0.10            5.23                31
 Additional Defaults
                  18
                   9
                   5
                   4
                   4
                   4
                   3
                   3
                   2
                   3
> 
> plot(contdr)
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... push.vp.vpTree -> push.vp -> push.vp.viewport -> grid.Call.graphics
Execution halted