diff --git a/rsAbsence.Rnw b/rsAbsence.Rnw index 4ff1fa16cc23d55e2c46842404b7ea37490963cf..d1732b1a6fa2d4fd324c981a7ba76afb588f7922 100755 --- a/rsAbsence.Rnw +++ b/rsAbsence.Rnw @@ -71,6 +71,7 @@ Reproducibility <- TRUE ## packages library(ggplot2) # plotting library(dplyr) # data manipulation +library(ggrepel) # to highlight data points with non-overlapping labels ## the replication Bayes factor under normality BFr <- function(to, tr, so, sr) { @@ -261,7 +262,11 @@ pbreaks <- c(0.005, 0.02, 0.05, 0.15, 0.4) ggplot(data = rpcbNull, aes(x = po, y = po2)) + geom_abline(intercept = 0, slope = 1, alpha = 0.2) + geom_vline(xintercept = 0.05, alpha = 0.2, lty = 2) + - geom_point() + + geom_hline(yintercept = 0.05, alpha = 0.2, lty = 2) + + geom_point(alpha = 0.8, shape = 21, fill = "darkgrey") + + geom_label_repel(data = filter(rpcbNull, po2 < 0.05), + aes(x = po, y = po2, label = id), alpha = 0.8, size = 3, + min.segment.length = 0, box.padding = 0.7) + labs(x = bquote(italic(p["o"]) ~ "(reported)"), y = bquote(italic(p["o"]) ~ "(recomputed under normality)")) + scale_x_log10(breaks = pbreaks, label = scales::percent) +