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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plot.ei_compare
> ### Title: Plot Method for class ei_compare
> ### Aliases: plot.ei_compare
> 
> ### ** Examples
> 
> 
> # TOY DATA EXAMPLE
> canda <- c(.1, .09, .85, .9, .92)
> candb <- 1-canda
> white <- c(.8, .9, .10, .08, .11)
> black <- 1 - white
> total <- c(30,80, 70, 20, 29)
> toy <- data.frame(canda, candb, white, black, total)
> 
> # CREATE VECTORS
> cands <- c("canda")
> race_group <- c("~ black") # only use one group for example
> table_names <- c("EI: PCT Black", "EI: PCT White")
> 
> # RUN ei_est_gen()
> # KEEP DATA TO JUST ONE ROW FOR EXAMPLE (time) ONLY!
> results <- ei_est_gen(cands, race_group, "total",
+                       data = toy[c(1,3,5),], table_names = table_names, sample=100)
[1] "Running 2x2 ei"
Maximizing likelihood
Importance Sampling..
Model: canda ~ black 
$Erho
[1] 10

$Esigma
[1] 0.5

$Ebeta
[1] 0.5

$N
[1] 3

$Resamp
[1] 18

$`Maximum likelihood results in scale of estimation (and se's)`
      Bb0        Bw0       sigB       sigW      rho Zb Zw
 1.538939 -0.6399367 -1.0556855 -1.6603567 5.308277  0  0
 1.008226  0.8526302  0.5324106  0.5337856 3.825791  0  0

$`Untruncated psi's`
       BB        BW        SB        SW      RHO
 1.040192 0.3068188 0.3706888 0.2048874 0.949214

$`Truncated psi's (ultimate scale)`
        BB        BW        SB        SW       RHO
 0.7908538 0.1918214 0.2384446 0.1468976 0.8573633

$`Aggregate Bounds`
          betab      betaw
lower 0.8014977 0.02544604
upper 0.9314418 0.38578532

$`Estimates of Aggregate Quantities of Interest`
        mean          sd
Bb 0.9088485 0.009498466
Bw 0.0880981 0.026339559

$precision
[1] 4

attr(,"class")
[1] "summary"
> 
> # Generate formula for passage to ei.reg.bayes() function
> form <- formula(cbind(canda,candb) ~ cbind(black, white)) 
> # Run Bayesian model
> suppressWarnings (
+   ei_bayes <- ei.reg.bayes(form, data=toy, sample=100, truncate=TRUE)
+ )
> 
> table_names <- c("RxC: PCT Black", "RxC: PCT White")
> cands <- c("canda", "candb")
> ei_bayes_res <- bayes_table_make(ei_bayes, cand_vector= cands, table_names = table_names)
> ei_bayes_res <- ei_bayes_res[c(1,2,5),]
> # Combine Results, results in object of class ei_compare 
> ei_rc_combine <- ei_rc_good_table(results, ei_bayes_res, 
+                                   groups= c("Black", "White")
+ )
> # Produces data and character vector, which can be sent to plot()
> ei_rc_combine
An object of class "ei_compare"
Slot "data":
  Candidate EI: PCT Black RxC: PCT Black  EI_Diff EI: PCT White RxC: PCT White
1     canda         79.08       95.03174 15.95174     19.176667       3.631835
2        se          2.64        4.06480       NA      5.913333       4.730655
5     Total         79.08       99.56507 20.48507     19.176667     100.744548
    EI_Diff
1 -15.54483
2        NA
5  81.56788

Slot "groups":
[1] "Black" "White"

> 
> # PLOT EI DIFFERENCES
> plot(ei_rc_combine)
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