Skip to content

Commit 983b5d5

Browse files
committed
Fix use of qplot in plot_rand_KLD.
1 parent bdd0596 commit 983b5d5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

R/debug.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@ plot_rand_KLD <- function(x, n=12, log=TRUE, tail=FALSE) {
6060
s <- sd(kld_rand[k, ])
6161
q95 <- quantile(kld_rand[k, ], 0.95)
6262
n95 <- qnorm(0.95, mean=m, sd=s)
63-
qplot(kld_rand[k, ], bins=30) +
63+
d <- data.frame(kld_rand=kld_rand[k, ])
64+
ggplot(d, aes(.data[["kld_rand"]])) +
65+
geom_histogram(bins=30) +
6466
geom_vline(xintercept=m, color="limegreen") +
6567
geom_vline(xintercept=c(m-s, m+s), color="violetred") +
6668
geom_vline(xintercept=q95, color="steelblue1") +
6769
geom_vline(xintercept=n95, color="red") +
6870
theme(axis.text=element_blank()) +
6971
labs(x=k, subtitle=paste0("log10CV: ", format(logcv[k], digits=2, nsmall=2)))
7072
})
71-
73+
7274
patchwork::wrap_plots(p)
7375
}

0 commit comments

Comments
 (0)