From a128fe2fec5d715227cdf8235af9bcb89d3a400e Mon Sep 17 00:00:00 2001 From: Christian Roever <christian.roever@med.uni-goettingen.de> Date: Tue, 19 Sep 2023 18:49:40 +0200 Subject: [PATCH] small internal changes in ...() function --- R/bayesmeta.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/bayesmeta.R b/R/bayesmeta.R index e2a9c49..8032918 100644 --- a/R/bayesmeta.R +++ b/R/bayesmeta.R @@ -453,8 +453,8 @@ bayesmeta.default <- function(y, sigma, labels=names(y), stopifnot(n>0, n==round(n), length(individual)==1, !is.logical(individual) || !individual) if (tau.sample) { # draw joint, bivariate (tau,mu) pairs: - samp <- matrix(NA, nrow=n, ncol=2, dimnames=list(NULL,c("tau","mu"))) - if (is.numeric(individual) | is.character(individual)) + samp <- matrix(NA_real_, nrow=n, ncol=2, dimnames=list(NULL,c("tau","mu"))) + if (predict | is.numeric(individual) | is.character(individual)) colnames(samp)[2] <- "theta" u <- runif(n=n) samp[,"tau"] <- apply(matrix(u,ncol=1), 1, function(x){return(qposterior(tau.p=x))}) @@ -465,7 +465,7 @@ bayesmeta.default <- function(y, sigma, labels=names(y), } samp[,2] <- apply(matrix(samp[,"tau"],ncol=1), 1, cond.sample) } else { # draw marginal, univariate (mu or theta) numbers: - samp <- rep(NA, n) + samp <- rep(NA_real_, n) if (!predict & (is.logical(individual) && (!individual))) meansd <- support[,c("mean","sd")] else -- GitLab