Running examples in 'PublicationBias-Ex.R' failed
The error most likely occurred in:

> ### Name: corrected_meta
> ### Title: Estimate publication bias-corrected meta-analysis
> ### Aliases: corrected_meta
> 
> ### ** Examples
> 
>  # calculate effect sizes from example dataset in metafor
>  require(metafor)
Loading required package: metafor
Loading required package: Matrix
Loading 'metafor' package (version 2.4-0). For an overview 
and introduction to the package please type: help(metafor).
>  dat = metafor::escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
> 
>  # first fit fixed-effects model without any bias correction
>  # since the point estimate is negative here, we'll assume publication bias favors negative
>  #  log-RRs rather than positive ones
>  rma( yi, vi, data = dat, method = "FE" )

Fixed-Effects Model (k = 13)

I^2 (total heterogeneity / total variability):   92.12%
H^2 (total variability / sampling variability):  12.69

Test for Heterogeneity:
Q(df = 12) = 152.2330, p-val < .0001

Model Results:

estimate      se      zval    pval    ci.lb    ci.ub 
 -0.4303  0.0405  -10.6247  <.0001  -0.5097  -0.3509  *** 

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

> 
>  # warmup
>  # note that passing eta = 1 (no publication bias) yields the naive point estimate
>  #  from rma above, which makes sense
>  corrected_meta( yi = dat$yi,
+                  vi = dat$vi,
+                  eta = 1,
+                  model = "fixed",
+                  favor.positive = FALSE )
         est         se         lo        hi         pval eta k.affirmative
1 -0.4302852 0.04049875 -0.5185244 -0.342046 1.853813e-07   1             8
  k.nonaffirmative signs.recoded
1                5          TRUE
> 
>  # assume a known selection ratio of 5
>  # i.e., affirmative results are 5x more likely to be published
>  #  than nonaffirmative
>  corrected_meta( yi = dat$yi,
+                  vi = dat$vi,
+                  eta = 5,
+                  favor.positive = FALSE,
+                  model = "fixed" )
         est         se         lo          hi        pval eta k.affirmative
1 -0.1555358 0.04913308 -0.2625876 -0.04848406 0.008135763   5             8
  k.nonaffirmative signs.recoded
1                5          TRUE
> 
>  # same selection ratio, but now account for heterogeneity
>  # and clustering via robust specification
>  corrected_meta( yi = dat$yi,
+                  vi = dat$vi,
+                  eta = 5,
+                  favor.positive = FALSE,
+                  clustervar = dat$author,
+                  model = "robust" )
         est        se         lo         hi       pval eta k.affirmative
1 -0.3686171 0.1452243 -0.7849406 0.04770646 0.06905043   5             8
  k.nonaffirmative signs.recoded
1                5          TRUE
> 
>  ##### Make sensitivity plot as in Mathur & VanderWeele (2020) #####
>  # range of parameters to try (more dense at the very small ones)
>  eta.list = as.list( c( 200, 150, 100, 50, 40, 30, 20, rev( seq(1,15,1) ) ) )
>  res.list = lapply( eta.list, function(x) {
+                      cat("\n Working on eta = ", x)
+                      return( corrected_meta( yi = dat$yi,
+                                              vi = dat$vi,
+                                              eta = x,
+                                              model = "robust",
+                                              favor.positive = FALSE,
+                                              clustervar = dat$author ) )
+                                          }
+                        )

 Working on eta =  200
 Working on eta =  150
 Working on eta =  100
 Working on eta =  50
 Working on eta =  40
 Working on eta =  30
 Working on eta =  20
 Working on eta =  15
 Working on eta =  14
 Working on eta =  13
 Working on eta =  12
 Working on eta =  11
 Working on eta =  10
 Working on eta =  9
 Working on eta =  8
 Working on eta =  7
 Working on eta =  6
 Working on eta =  5
 Working on eta =  4
 Working on eta =  3
 Working on eta =  2
 Working on eta =  1> 
>  # put results for each eta in a dataframe
>  res.df = as.data.frame( do.call( "rbind", res.list ) )
> 
>  require(ggplot2)
Loading required package: ggplot2
>  ggplot( data = res.df, aes( x = eta, y = est ) ) +
+ 
+    geom_ribbon( data = res.df, aes( x = eta, ymin = lo, ymax = hi ), fill = "gray" ) +
+ 
+    geom_line( lwd = 1.2 ) +
+    xlab( bquote( eta ) ) +
+    ylab( bquote( hat(mu)[eta] ) ) +
+ 
+    theme_classic()
Error in update_tibble_attrs(x, ...) : 
  object 'tibble_update_attrs' not found
Calls: <Anonymous> ... recycle_columns -> new_tibble -> update_tibble_attrs
Execution halted