diff --git a/modules/meta.analysis/R/approx.posterior.R b/modules/meta.analysis/R/approx.posterior.R index 451f9d29467..ca66f183b4f 100644 --- a/modules/meta.analysis/R/approx.posterior.R +++ b/modules/meta.analysis/R/approx.posterior.R @@ -67,8 +67,8 @@ approx.posterior <- function(trait.mcmc, priors, trait.data = NULL, outdir = NUL if (!is.null(trait.data)) { graphics::rug(trait.data[[trait]]$Y, lwd = 2, col = "purple") } - graphics::lines(x, dbeta(x, fit$estimate[1], fit$estimate[2]), lwd = 2, type = "l") - graphics::lines(x, dbeta(x, pparm[1], pparm[2]), lwd = 3, type = "l", col = 3) + graphics::lines(x, stats::dbeta(x, fit$estimate[1], fit$estimate[2]), lwd = 2, type = "l") + graphics::lines(x, stats::dbeta(x, pparm[1], pparm[2]), lwd = 3, type = "l", col = 3) graphics::legend("topleft", legend = c("data", "prior", "post", "approx"), col = c("purple", 3, 2, 1), lwd = 2) @@ -93,7 +93,7 @@ approx.posterior <- function(trait.mcmc, priors, trait.data = NULL, outdir = NUL dist.names <- dist.names[!failfit.bool] fparm <- lapply(fit, function(x) { as.numeric(x$estimate) }) - fAIC <- lapply(fit, AIC) + fAIC <- lapply(fit, stats::AIC) bestfit <- which.min(fAIC) posteriors[ptrait, "distn"] <- dist.names[bestfit] diff --git a/modules/meta.analysis/R/jagify.R b/modules/meta.analysis/R/jagify.R index ab8c1dd0d86..10ecdc5c95b 100644 --- a/modules/meta.analysis/R/jagify.R +++ b/modules/meta.analysis/R/jagify.R @@ -34,15 +34,15 @@ jagify <- function(result, use_ghs = TRUE) { r <- PEcAn.DB::assign.treatments(r) r <- PEcAn.utils::summarize.result(r) r <- subset(transform(r, - stat = as.numeric(stat), - n = as.numeric(n), - site_id = as.integer(factor(site_id, unique(site_id))), - greenhouse = as.integer(factor(greenhouse, unique(greenhouse))), + r$stat <- as.numeric(r$stat), + r$n <- as.numeric(r$n), + r$site_id <- as.integer(factor(r$site_id, unique(r$site_id))), + r$greenhouse <- as.integer(factor(r$greenhouse, unique(r$greenhouse))), mean = mean, - citation_id = citation_id, - ghs = greenhouse, - site = site_id, - trt_name = name), + r$citation_id <- r$citation_id, + ghs = r$greenhouse, + site = r$site_id, + trt_name = r$name), select = c("stat", "n", "site_id", "trt_id", "mean", "citation_id", "greenhouse", "ghs", "treatment_id", "site", "trt_name")) # original versions of greenhouse, treatment_id, site_id, and name