From 3ded79dec2d4c40c613d95200876e4ce149c6f8d Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Fri, 25 Sep 2020 17:09:57 -0400 Subject: [PATCH] coda rises from the dead --- DESCRIPTION | 2 +- R/MCMCglmm_prediction.R | 2 -- R/brms_tidiers.R | 2 -- R/mcmc_tidiers.R | 6 ------ R/rstanarm_tidiers.R | 2 -- 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b94b54d..be67beb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,6 +31,7 @@ Description: Convert fitted objects from various R mixed-model packages provides a one-row summary of model-level statistics. Imports: broom, + coda, dplyr, methods, nlme, @@ -40,7 +41,6 @@ Imports: tidyr Suggests: brms, - coda, dotwhisker, knitr, testthat, diff --git a/R/MCMCglmm_prediction.R b/R/MCMCglmm_prediction.R index 3d698c8..0c1964c 100644 --- a/R/MCMCglmm_prediction.R +++ b/R/MCMCglmm_prediction.R @@ -81,8 +81,6 @@ predict2.MCMCglmm <- function(object, X, Z, use = c("all", "mean"), type = c("lp", "response"), ...) { - assert_dependency("coda") - use <- match.arg(use) type <- match.arg(type) diff --git a/R/brms_tidiers.R b/R/brms_tidiers.R index 8e1adaa..bc595aa 100644 --- a/R/brms_tidiers.R +++ b/R/brms_tidiers.R @@ -256,8 +256,6 @@ tidy.brmsfit <- function(x, parameters = NA, out$std.error <- apply(samples, 2, stdfun) if (conf.int) { - assert_dependency("coda") - stopifnot(length(conf.level) == 1L) probs <- c((1 - conf.level) / 2, 1 - (1 - conf.level) / 2) if (conf.method == "HPDinterval") { diff --git a/R/mcmc_tidiers.R b/R/mcmc_tidiers.R index 34b7e32..65784f7 100644 --- a/R/mcmc_tidiers.R +++ b/R/mcmc_tidiers.R @@ -82,8 +82,6 @@ tidyMCMC <- function(x, index = FALSE, ...) { - assert_dependency("coda") - conf.method <- match.arg(conf.method) stan <- inherits(x, "stanfit") @@ -156,8 +154,6 @@ tidy.rjags <- function(x, conf.method = "quantile", ...) { - assert_dependency("coda") - tidyMCMC(coda::as.mcmc(x$BUGS), robust = robust, conf.int = conf.int, @@ -183,8 +179,6 @@ tidy.mcmc.list <- tidyMCMC ## copied from emdbook ... as.mcmc.bugs <- function (x) { - assert_dependency("coda") - if (x$n.chains > 1) { z <- list() for (i in 1:x$n.chains) { diff --git a/R/rstanarm_tidiers.R b/R/rstanarm_tidiers.R index 113ea15..633115e 100644 --- a/R/rstanarm_tidiers.R +++ b/R/rstanarm_tidiers.R @@ -115,8 +115,6 @@ tidy.stanreg <- function(x, if (conf.int) { - assert_dependency("coda") - cifix <- switch(conf.method, HPDinterval= { m <- as.matrix(x$stanfit)