From f7c5474a3172a1d7655b91ef1d0e0c6de7df92c1 Mon Sep 17 00:00:00 2001 From: Wolfgang Viechtbauer Date: Mon, 6 May 2024 16:15:28 +0200 Subject: [PATCH] Added internal .expand1() function. --- DESCRIPTION | 4 +- NEWS.md | 2 +- R/addpoly.default.r | 20 ++----- R/aggregate.escalc.r | 12 ++-- R/anova.rma.r | 12 ++-- R/baujat.rma.r | 3 +- R/blup.rma.uni.r | 3 +- R/confint.rma.ls.r | 6 +- R/conv.2x2.r | 3 +- R/conv.delta.r | 3 +- R/conv.fivenum.r | 8 +-- R/conv.wald.r | 3 +- R/dfround.r | 7 +-- R/escalc.r | 61 +++++++-------------- R/forest.cumul.rma.r | 15 ++--- R/forest.default.r | 16 ++---- R/forest.rma.r | 15 ++--- R/formatters.r | 3 +- R/fsn.r | 3 +- R/funnel.default.r | 3 +- R/funnel.rma.r | 3 +- R/labbe.rma.r | 12 ++-- R/llplot.r | 25 +++------ R/misc.func.hidden.mv.r | 9 +-- R/misc.func.hidden.r | 6 ++ R/plot.gosh.rma.r | 3 +- R/plot.profile.rma.r | 10 +--- R/predict.rma.ls.r | 3 +- R/predict.rma.r | 9 +-- R/profile.rma.ls.r | 6 +- R/ranef.rma.uni.r | 3 +- R/regplot.rma.r | 24 +++----- R/replmiss.r | 3 +- R/rma.mv.r | 24 +++----- R/rma.uni.r | 19 ++----- R/selmodel.rma.uni.r | 12 ++-- R/summary.escalc.r | 3 +- R/transf.r | 12 ++-- R/zzz.r | 2 +- README.md | 2 +- docs/404.html | 2 +- docs/ISSUE_TEMPLATE.html | 2 +- docs/articles/index.html | 2 +- docs/articles/pkgdown/diagram.html | 2 +- docs/authors.html | 2 +- docs/index.html | 4 +- docs/news/index.html | 4 +- docs/pkgdown.yml | 2 +- docs/reference/addpoly.default.html | 2 +- docs/reference/addpoly.html | 2 +- docs/reference/addpoly.predict.rma.html | 2 +- docs/reference/addpoly.rma.html | 2 +- docs/reference/aggregate.escalc.html | 2 +- docs/reference/anova.rma.html | 2 +- docs/reference/baujat.html | 2 +- docs/reference/bldiag.html | 2 +- docs/reference/blsplit.html | 2 +- docs/reference/blup.html | 2 +- docs/reference/coef.permutest.rma.uni.html | 2 +- docs/reference/coef.rma.html | 2 +- docs/reference/confint.rma.html | 2 +- docs/reference/contrmat.html | 2 +- docs/reference/conv.2x2.html | 2 +- docs/reference/conv.delta.html | 2 +- docs/reference/conv.fivenum.html | 2 +- docs/reference/conv.wald.html | 2 +- docs/reference/cumul.html | 2 +- docs/reference/dfround.html | 2 +- docs/reference/emmprep.html | 2 +- docs/reference/escalc.html | 2 +- docs/reference/fitstats.html | 2 +- docs/reference/fitted.rma.html | 2 +- docs/reference/forest.cumul.rma.html | 2 +- docs/reference/forest.default.html | 2 +- docs/reference/forest.html | 2 +- docs/reference/forest.rma.html | 2 +- docs/reference/formatters.html | 2 +- docs/reference/formula.rma.html | 6 +- docs/reference/fsn.html | 2 +- docs/reference/funnel.html | 2 +- docs/reference/gosh.html | 2 +- docs/reference/hc.html | 2 +- docs/reference/index.html | 2 +- docs/reference/influence.rma.mv.html | 2 +- docs/reference/influence.rma.uni.html | 2 +- docs/reference/labbe.html | 2 +- docs/reference/leave1out.html | 2 +- docs/reference/llplot.html | 2 +- docs/reference/matreg.html | 2 +- docs/reference/metafor-package.html | 2 +- docs/reference/metafor.news.html | 4 +- docs/reference/methods.anova.rma.html | 2 +- docs/reference/methods.confint.rma.html | 2 +- docs/reference/methods.escalc.html | 2 +- docs/reference/methods.list.rma.html | 2 +- docs/reference/methods.matreg.html | 2 +- docs/reference/methods.vif.rma.html | 2 +- docs/reference/mfopt.html | 2 +- docs/reference/misc-models.html | 2 +- docs/reference/misc-options.html | 2 +- docs/reference/misc-recs.html | 2 +- docs/reference/model.matrix.rma.html | 2 +- docs/reference/permutest.html | 2 +- docs/reference/plot.cumul.rma.html | 2 +- docs/reference/plot.gosh.rma.html | 2 +- docs/reference/plot.infl.rma.uni.html | 2 +- docs/reference/plot.permutest.rma.uni.html | 2 +- docs/reference/plot.rma.html | 2 +- docs/reference/plot.rma.uni.selmodel.html | 2 +- docs/reference/plot.vif.rma.html | 2 +- docs/reference/predict.rma.html | 2 +- docs/reference/print.anova.rma.html | 2 +- docs/reference/print.confint.rma.html | 2 +- docs/reference/print.escalc.html | 2 +- docs/reference/print.fsn.html | 2 +- docs/reference/print.gosh.rma.html | 2 +- docs/reference/print.hc.rma.uni.html | 2 +- docs/reference/print.list.rma.html | 2 +- docs/reference/print.matreg.html | 2 +- docs/reference/print.permutest.rma.uni.html | 2 +- docs/reference/print.ranktest.rma.html | 2 +- docs/reference/print.regtest.rma.html | 2 +- docs/reference/print.rma.html | 2 +- docs/reference/profile.rma.html | 2 +- docs/reference/qqnorm.rma.html | 2 +- docs/reference/radial.html | 2 +- docs/reference/ranef.html | 2 +- docs/reference/ranktest.html | 2 +- docs/reference/rcalc.html | 2 +- docs/reference/regplot.html | 2 +- docs/reference/regtest.html | 2 +- docs/reference/replmiss.html | 2 +- docs/reference/reporter.html | 6 +- docs/reference/residuals.rma.html | 2 +- docs/reference/rma.glmm.html | 2 +- docs/reference/rma.mh.html | 2 +- docs/reference/rma.mv.html | 2 +- docs/reference/rma.peto.html | 2 +- docs/reference/rma.uni.html | 2 +- docs/reference/robust.html | 2 +- docs/reference/se.html | 2 +- docs/reference/selmodel.html | 2 +- docs/reference/simulate.rma.html | 2 +- docs/reference/tes.html | 2 +- docs/reference/to.long.html | 2 +- docs/reference/to.table.html | 2 +- docs/reference/to.wide.html | 2 +- docs/reference/transf.html | 2 +- docs/reference/trimfill.html | 2 +- docs/reference/update.rma.html | 2 +- docs/reference/vcalc.html | 2 +- docs/reference/vcov.rma.html | 2 +- docs/reference/vec2mat.html | 2 +- docs/reference/vif.html | 2 +- docs/reference/weights.rma.html | 2 +- 155 files changed, 258 insertions(+), 378 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index bb62e0d1e..d00aaaf84 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: metafor -Version: 4.7-10 -Date: 2024-04-29 +Version: 4.7-11 +Date: 2024-05-06 Title: Meta-Analysis Package for R Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "wvb@metafor-project.org", comment = c(ORCID = "0000-0003-3463-4063")) Depends: R (>= 4.0.0), methods, Matrix, metadat, numDeriv diff --git a/NEWS.md b/NEWS.md index bb2a06ff8..83d28f49b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# metafor 4.7-10 (2024-04-29) +# metafor 4.7-11 (2024-05-06) - `rma.mv()` now counts the number of levels of a random effect more appropriately; this may trigger more often the check whether the number of levels is equal to 1, in which case the corresponding variance component is automatically fixed to 0; this check can be omitted with `control=list(check.k.gtr.1=FALSE)` diff --git a/R/addpoly.default.r b/R/addpoly.default.r index 1b04242eb..805410509 100644 --- a/R/addpoly.default.r +++ b/R/addpoly.default.r @@ -93,8 +93,7 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ... if (is.null(mlab)) { mlab <- rep("", k) } else { - if (length(mlab) == 1L) - mlab <- rep(mlab, k) + mlab <- .expand1(mlab, k) if (length(mlab) != k) stop(mstyle$stop(paste0("Length of the 'mlab' argument (", length(mlab), ") does not correspond to the number of polygons to be plotted (", k, ")."))) } @@ -127,8 +126,7 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ... if (is.null(fonts)) { fonts <- rep(par("family"), 2L) } else { - if (length(fonts) == 1L) - fonts <- rep(fonts, 2L) + fonts <- .expand1(fonts, 2L) } if (is.null(names(fonts))) @@ -334,8 +332,7 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ... if (is.null(width)) { width <- apply(annotext, 2, function(x) max(nchar(x))) } else { - if (length(width) == 1L) - width <- rep(width, ncol(annotext)) + width <- .expand1(width, ncol(annotext)) } for (j in seq_len(ncol(annotext))) { @@ -354,14 +351,9 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ... } - if (length(col) == 1L) - col <- rep(col, k) - - if (length(border) == 1L) - border <- rep(border, k) - - if (length(lcol) == 1L) - lcol <- rep(lcol, k) + col <- .expand1(col, k) + border <- .expand1(border, k) + lcol <- .expand1(lcol, k) if (isTRUE(constarea)) { areas <- (ci.ub - ci.lb) * (height/100)*cex*efac[1] diff --git a/R/aggregate.escalc.r b/R/aggregate.escalc.r index 89348bf58..d5e53c616 100644 --- a/R/aggregate.escalc.r +++ b/R/aggregate.escalc.r @@ -12,8 +12,7 @@ aggregate.escalc <- function(x, cluster, time, obs, V, struct="CS", rho, phi, if (missing(cluster)) stop(mstyle$stop("Must specify 'cluster' variable.")) - if (length(na.rm) == 1L) - na.rm <- c(na.rm, na.rm) + na.rm <- .expand1(na.rm, 2L) k <- nrow(x) @@ -102,8 +101,7 @@ aggregate.escalc <- function(x, cluster, time, obs, V, struct="CS", rho, phi, if (missing(rho)) stop(mstyle$stop("Must specify 'rho' for this var-cov structure.")) - if (length(rho) == 1L) - rho <- rep(rho, n) + rho <- .expand1(rho, n) if (length(rho) != n) stop(mstyle$stop(paste0("Length of 'rho' (", length(rho), ") does not match the number of clusters (", n, ")."))) @@ -118,8 +116,7 @@ aggregate.escalc <- function(x, cluster, time, obs, V, struct="CS", rho, phi, if (missing(phi)) stop(mstyle$stop("Must specify 'phi' for this var-cov structure.")) - if (length(phi) == 1L) - phi <- rep(phi, n) + phi <- .expand1(phi, n) if (length(phi) != n) stop(mstyle$stop(paste0("Length of 'phi' (", length(phi), ") does not match the number of clusters (", n, ")."))) @@ -195,8 +192,7 @@ aggregate.escalc <- function(x, cluster, time, obs, V, struct="CS", rho, phi, if (.is.vector(V)) { - if (length(V) == 1L) - V <- rep(V, k) + V <- .expand1(V, k) if (length(V) != k) stop(mstyle$stop(paste0("Length of 'V' (", length(V), ") does not match length of data frame (", k, ")."))) diff --git a/R/anova.rma.r b/R/anova.rma.r index 8e82232f4..38947ea77 100644 --- a/R/anova.rma.r +++ b/R/anova.rma.r @@ -69,8 +69,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE, if (missing(rhs)) { rhs <- rep(0, m) } else { - if (length(rhs) == 1L) - rhs <- rep(rhs, m) + rhs <- .expand1(rhs, m) if (length(rhs) != m) stop(mstyle$stop(paste0("Length of 'rhs' (", length(rhs), ") does not match the number of coefficients tested (", m, ")."))) } @@ -118,8 +117,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE, if (missing(rhs)) { rhs <- rep(0, m) } else { - if (length(rhs) == 1L) - rhs <- rep(rhs, m) + rhs <- .expand1(rhs, m) if (length(rhs) != m) stop(mstyle$stop(paste0("Length of 'rhs' (", length(rhs), ") does not match the number of coefficients tested (", m, ")."))) } @@ -193,8 +191,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE, if (missing(rhs)) { rhs <- rep(0, m) } else { - if (length(rhs) == 1L) - rhs <- rep(rhs, m) + rhs <- .expand1(rhs, m) if (length(rhs) != m) stop(mstyle$stop(paste0("Length of 'rhs' (", length(rhs), ") does not match the number of linear combinations (", m, ")."))) } @@ -345,8 +342,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE, if (missing(rhs)) { rhs <- rep(0, m) } else { - if (length(rhs) == 1L) - rhs <- rep(rhs, m) + rhs <- .expand1(rhs, m) if (length(rhs) != m) stop(mstyle$stop(paste0("Length of 'rhs' (", length(rhs), ") does not match the number of linear combinations (", m, ")."))) } diff --git a/R/baujat.rma.r b/R/baujat.rma.r index 958a9d4ef..815be77a1 100644 --- a/R/baujat.rma.r +++ b/R/baujat.rma.r @@ -133,8 +133,7 @@ baujat.rma <- function(x, xlim, ylim, xlab, ylab, cex, symbol="ids", grid=TRUE, if (is.numeric(symbol)) { - if (length(symbol) == 1L) - symbol <- rep(symbol, x$k.all) + symbol <- .expand1(symbol, x$k.all) if (length(symbol) != x$k.all) stop(mstyle$stop(paste0("Length of the 'symbol' argument (", length(symbol), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) diff --git a/R/blup.rma.uni.r b/R/blup.rma.uni.r index ecc373f8e..8a1f08c8e 100644 --- a/R/blup.rma.uni.r +++ b/R/blup.rma.uni.r @@ -45,8 +45,7 @@ blup.rma.uni <- function(x, level, digits, transf, targs, ...) { ### see Appendix in: Raudenbush, S. W., & Bryk, A. S. (1985). Empirical ### Bayes meta-analysis. Journal of Educational Statistics, 10(2), 75-98 - if (length(x$tau2.f) == 1L) - x$tau2.f <- rep(x$tau2.f, length(x$yi.f)) + x$tau2.f <- .expand1(x$tau2.f, length(x$yi.f)) li <- ifelse(is.infinite(x$tau2.f), 1, x$tau2.f / (x$tau2.f + x$vi.f)) diff --git a/R/confint.rma.ls.r b/R/confint.rma.ls.r index ee7a5f2ec..dcfb197b2 100644 --- a/R/confint.rma.ls.r +++ b/R/confint.rma.ls.r @@ -165,13 +165,11 @@ confint.rma.ls <- function(object, parm, level, fixed=FALSE, alpha, digits, tran } if (!is.null(x$control$alpha.min)) { - if (length(x$control$alpha.min) == 1L) - x$control$alpha.min <- rep(x$control$alpha.min, x$q) + x$control$alpha.min <- .expand1(x$control$alpha.min, x$q) con$vc.min <- max(con$vc.min, x$control$alpha.min[alpha]) } if (!is.null(x$control$alpha.max)) { - if (length(x$control$alpha.max) == 1L) - x$control$alpha.max <- rep(x$control$alpha.max, x$q) + x$control$alpha.max <- .expand1(x$control$alpha.max, x$q) con$vc.max <- min(con$vc.max, x$control$alpha.max[alpha]) } diff --git a/R/conv.2x2.r b/R/conv.2x2.r index d90a8b172..465aee759 100644 --- a/R/conv.2x2.r +++ b/R/conv.2x2.r @@ -70,8 +70,7 @@ conv.2x2 <- function(ori, ri, x2i, ni, n1i, n2i, correct=TRUE, data, include, ### handle correct argument - if (length(correct) == 1L) - correct <- rep(correct, k) + correct <- .expand1(correct, k) if (length(correct) != k) stop(mstyle$stop(paste0("Length of 'correct' argument (", length(correct), ") does not match length of data (", k, ")."))) diff --git a/R/conv.delta.r b/R/conv.delta.r index 7db4b7043..0ea4e7f4c 100644 --- a/R/conv.delta.r +++ b/R/conv.delta.r @@ -139,8 +139,7 @@ conv.delta <- function(yi, vi, ni, data, include, transf, var.names, append=TRUE for (i in seq_along(dotargs)) { dotarglist[[i]] <- .getx(dotargs[i], mf=mf, data=x, checknumeric=TRUE) - if (length(dotarglist[[i]]) == 1L) - dotarglist[[i]] <- rep(dotarglist[[i]], k) + dotarglist[[i]] <- .expand1(dotarglist[[i]], k) names(dotarglist)[i] <- dotargs[i] } diff --git a/R/conv.fivenum.r b/R/conv.fivenum.r index 1047a39b4..db909583a 100644 --- a/R/conv.fivenum.r +++ b/R/conv.fivenum.r @@ -87,8 +87,7 @@ conv.fivenum <- function(min, q1, median, q3, max, n, data, include, ### handle dist argument - if (length(dist) == 1L) - dist <- rep(dist, k) + dist <- .expand1(dist, k) if (length(dist) != k) stop(mstyle$stop(paste0("Length of 'dist' argument (", length(dist), ") does not match length of data (", k, ")."))) @@ -132,8 +131,7 @@ conv.fivenum <- function(min, q1, median, q3, max, n, data, include, method <- tolower(method) - if (length(method) == 1L) - method <- c(method, method) + method <- .expand1(method, 2L) method1.options <- c("default", "luo/wan/shi", "qe", "bc", "mln", "blue", "hozo2005", "wan2014", "bland2015", "luo2016", "walter2007") method2.options <- c("default", "luo/wan/shi", "qe", "bc", "mln", "blue", "hozo2005", "wan2014", "bland2015", "shi2020", "walter2007") @@ -184,7 +182,7 @@ conv.fivenum <- function(min, q1, median, q3, max, n, data, include, tval <- rep(NA_real_, k) crit <- rep(NA_real_, k) sig <- rep(NA, k) - dists <- rep("norm", k) + dists <- rep("norm", k) for (i in seq_len(k)) { diff --git a/R/conv.wald.r b/R/conv.wald.r index daf1c767d..2a42397aa 100644 --- a/R/conv.wald.r +++ b/R/conv.wald.r @@ -145,8 +145,7 @@ conv.wald <- function(out, ci.lb, ci.ub, zval, pval, n, data, include, ### if level is a single value, expand to the appropriate length - if (length(level) == 1L) - level <- rep(level, k) + level <- .expand1(level, k) if (length(level) != k) stop(mstyle$stop(paste0("Length of the 'level' argument (", length(level), ") does not correspond to the size of the dataset (", k, ")."))) diff --git a/R/dfround.r b/R/dfround.r index abfae36d4..2ca56f864 100644 --- a/R/dfround.r +++ b/R/dfround.r @@ -12,11 +12,8 @@ dfround <- function(x, digits, drop0=TRUE) { if (missing(digits)) digits <- 0 - if (length(digits) == 1L) - digits <- rep(digits, p) - - if (length(drop0) == 1L) - drop0 <- rep(drop0, p) + digits <- .expand1(digits, p) + drop0 <- .expand1(drop0, p) if (p != length(digits)) stop(mstyle$stop(paste0("Number of columns in 'x' (", p, ") does not match length of 'digits' (", length(digits), ")."))) diff --git a/R/escalc.r b/R/escalc.r index 89a3454de..2fea1c323 100644 --- a/R/escalc.r +++ b/R/escalc.r @@ -341,8 +341,8 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. } else { yi <- p1i.u - p2i.u } - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -416,8 +416,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- (ai*di - bi*ci)/sqrt((ai+bi)*(ci+di)*(ai+ci)*(bi+di)) - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -866,8 +865,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- m1i - m2i - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -897,8 +895,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. cmi <- .cmicalc(mi, correct=correct) yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -938,8 +935,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sdpi yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -983,8 +979,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- log(m1i/m2i) - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1030,8 +1025,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. if (is.element(measure, c("RPB","ZPB"))) { # this only applies when measure="RPB/ZPB" - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1173,8 +1167,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. if (is.element(measure, c("COR","UCOR"))) { - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1283,8 +1276,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- ri - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1320,8 +1312,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- ri - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1408,8 +1399,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- r2i - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1557,8 +1547,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- pri.u } - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1614,8 +1603,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- log(pri.u) } - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1663,8 +1651,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- log(pri.u/(1-pri.u)) } - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -1908,8 +1895,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. yi <- mi sdpi <- sqrt(.wmean(sdi^2, ni-1, na.rm=TRUE)) - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -2101,8 +2087,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sddiffi yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -2135,8 +2120,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sd1i yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -2172,8 +2156,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sd1i yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -2206,8 +2189,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sdpi yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) @@ -2233,8 +2215,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var. di <- (m1i - m2i) / sdpi yi <- cmi * di - if (length(vtype) == 1L) - vtype <- rep(vtype, k) + vtype <- .expand1(vtype, k) vi <- rep(NA_real_, k) diff --git a/R/forest.cumul.rma.r b/R/forest.cumul.rma.r index 060819c80..f048fe0e0 100644 --- a/R/forest.cumul.rma.r +++ b/R/forest.cumul.rma.r @@ -113,8 +113,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { ### vertical expansion factor: 1st = CI end lines, 2nd = arrows - if (length(efac) == 1L) - efac <- rep(efac, 2L) + efac <- .expand1(efac, 2L) efac[efac == 0] <- NA @@ -250,20 +249,17 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { } - if (length(pch) == 1L) - pch <- rep(pch, k) + pch <- .expand1(pch, k) if (length(pch) != k) stop(mstyle$stop(paste0("Length of the 'pch' argument (", length(pch), ") does not correspond to the number of outcomes (", k, ")."))) - if (length(psize) == 1L) - psize <- rep(psize, k) + psize <- .expand1(psize, k) if (length(psize) != k) stop(mstyle$stop(paste0("Length of the 'psize' argument (", length(psize), ") does not correspond to the number of outcomes (", k, ")."))) - if (length(col) == 1L) - col <- rep(col, k) + col <- .expand1(col, k) if (length(col) != k) stop(mstyle$stop(paste0("Length of the 'col' argument (", length(col), ") does not correspond to the number of outcomes (", k, ")."))) @@ -748,8 +744,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { if (missing(width)) { width <- apply(annotext, 2, function(x) max(nchar(x))) } else { - if (length(width) == 1L) - width <- rep(width, ncol(annotext)) + width <- .expand1(width, ncol(annotext)) if (length(width) != ncol(annotext)) stop(mstyle$stop(paste0("Length of 'width' argument (", length(width), ") does not the match number of annotation columns (", ncol(annotext), ")."))) } diff --git a/R/forest.default.r b/R/forest.default.r index 2b460d814..71ec458f6 100644 --- a/R/forest.default.r +++ b/R/forest.default.r @@ -103,8 +103,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { ### vertical expansion factor: 1st = CI end lines, 2nd = arrows - if (length(efac) == 1L) - efac <- rep(efac, 2L) + efac <- .expand1(efac, 2L) efac[efac == 0] <- NA @@ -278,22 +277,20 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { } - if (length(pch) == 1L) - pch <- rep(pch, k) # pch can be a single value (which is then repeated) + pch <- .expand1(pch, k) # pch can be a single value (which is then repeated) if (length(pch) != k) stop(mstyle$stop(paste0("Length of the 'pch' argument (", length(pch), ") does not correspond to the number of outcomes (", k, ")."))) if (!is.null(psize)) { - if (length(psize) == 1L) # psize can be a single value (which is then repeated) - psize <- rep(psize, k) + if (length(psize) == 1L) + psize <- .expand1(psize, k) # psize can be a single value (which is then repeated) if (length(psize) != k) stop(mstyle$stop(paste0("Length of the 'psize' argument (", length(psize), ") does not correspond to the number of outcomes (", k, ")."))) } if (!is.null(col)) { - if (length(col) == 1L) # col can be a single value (which is then repeated) - col <- rep(col, k) + col <- .expand1(col, k) # col can be a single value (which is then repeated) if (length(col) != k) stop(mstyle$stop(paste0("Length of the 'col' argument (", length(col), ") does not correspond to the number of outcomes (", k, ")."))) } else { @@ -893,8 +890,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { if (missing(width)) { width <- apply(annotext, 2, function(x) max(nchar(x))) } else { - if (length(width) == 1L) - width <- rep(width, ncol(annotext)) + width <- .expand1(width, ncol(annotext)) if (length(width) != ncol(annotext)) stop(mstyle$stop(paste0("Length of 'width' argument (", length(width), ") does not match the number of annotation columns (", ncol(annotext), ")."))) } diff --git a/R/forest.rma.r b/R/forest.rma.r index 356403a1c..fb1d3ce7a 100644 --- a/R/forest.rma.r +++ b/R/forest.rma.r @@ -147,8 +147,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { ### vertical expansion factor: 1st = CI/PI end lines, 2nd = arrows, 3rd = summary polygon or fitted polygons - if (length(efac) == 1L) - efac <- rep(efac, 3L) + efac <- .expand1(efac, 3L) if (length(efac) == 2L) efac <- c(efac[1], efac[1], efac[2]) # if 2 values specified: 1st = CI/PI end lines and arrows, 2nd = summary polygon or fitted polygons @@ -334,8 +333,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { } - if (length(pch) == 1L) - pch <- rep(pch, x$k.all) + pch <- .expand1(pch, x$k.all) if (length(pch) != x$k.all) stop(mstyle$stop(paste0("Length of the 'pch' argument (", length(pch), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -344,8 +342,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { if (!is.null(psize)) { - if (length(psize) == 1L) - psize <- rep(psize, x$k.all) + psize <- .expand1(psize, x$k.all) if (length(psize) != x$k.all) stop(mstyle$stop(paste0("Length of the 'psize' argument (", length(psize), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -354,8 +351,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { } - if (length(colout) == 1L) - colout <- rep(colout, x$k.all) + colout <- .expand1(colout, x$k.all) if (length(colout) != x$k.all) stop(mstyle$stop(paste0("Length of the 'colout' argument (", length(colout), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -1161,8 +1157,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) { if (missing(width)) { width <- apply(annotext, 2, function(x) max(nchar(x))) } else { - if (length(width) == 1L) - width <- rep(width, ncol(annotext)) + width <- .expand1(width, ncol(annotext)) if (length(width) != ncol(annotext)) stop(mstyle$stop(paste0("Length of 'width' argument (", length(width), ") does not match the number of annotation columns (", ncol(annotext), ")."))) } diff --git a/R/formatters.r b/R/formatters.r index 97d4bd776..6dce4bc93 100644 --- a/R/formatters.r +++ b/R/formatters.r @@ -36,8 +36,7 @@ fmtx <- function(x, digits=4, flag="", quote=FALSE, ...) { if (length(dim(x)) == 2L) { - if (length(digits) == 1L) - digits <- rep(digits, ncol(x)) + digits <- .expand1(digits, ncol(x)) out <- matrix("", nrow=nrow(x), ncol=ncol(x)) diff --git a/R/fsn.r b/R/fsn.r index ee77261bd..c54f0f9e8 100644 --- a/R/fsn.r +++ b/R/fsn.r @@ -150,8 +150,7 @@ fsn <- function(x, vi, sei, subset, data, type, alpha=.05, target, ### allow easy setting of vi to a single value - if (length(vi) == 1L) - vi <- rep(vi, length(yi)) + vi <- .expand1(vi, length(yi)) ### check length of yi and vi diff --git a/R/funnel.default.r b/R/funnel.default.r index 7a595d4a4..513f83b13 100644 --- a/R/funnel.default.r +++ b/R/funnel.default.r @@ -174,8 +174,7 @@ label=FALSE, offset=0.4, legend=FALSE, ...) { ### note: digits can also be a list (e.g., digits=list(2L,3)); trailing 0's are dropped for integers - if (length(lty) == 1L) - lty <- rep(lty, 2L) # 1st value = funnel lines, 2nd value = reference line + lty <- .expand1(lty, 2L) # 1st value = funnel lines, 2nd value = reference line if (length(pch) == 1L) { pch.vec <- FALSE diff --git a/R/funnel.rma.r b/R/funnel.rma.r index 5fe0055c3..c4e50db35 100644 --- a/R/funnel.rma.r +++ b/R/funnel.rma.r @@ -128,8 +128,7 @@ label=FALSE, offset=0.4, legend=FALSE, ...) { ### note: digits can also be a list (e.g., digits=list(2L,3)); trailing 0's are dropped for integers - if (length(lty) == 1L) - lty <- rep(lty, 2L) # 1st value = funnel lines, 2nd value = reference line + lty <- .expand1(lty, 2L) # 1st value = funnel lines, 2nd value = reference line ### note: slab, pch, col, and bg (if vectors) must be of the same length as the original dataset ### so we have to apply the same subsetting (if necessary) and removing of NAs as was diff --git a/R/labbe.rma.r b/R/labbe.rma.r index df8ecbd04..2bb41537e 100644 --- a/R/labbe.rma.r +++ b/R/labbe.rma.r @@ -97,8 +97,7 @@ add=x$add, to=x$to, transf, targs, pch=21, psize, plim=c(0.5,3.5), col, bg, lty, ### so we have to apply the same subsetting (if necessary) and removing of NAs as was ### done during the model fitting (note: NAs are removed further below) - if (length(pch) == 1L) - pch <- rep(pch, x$k.all) + pch <- .expand1(pch, x$k.all) if (length(pch) != x$k.all) stop(mstyle$stop(paste0("Length of the 'pch' argument (", length(pch), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -108,8 +107,7 @@ add=x$add, to=x$to, transf, targs, pch=21, psize, plim=c(0.5,3.5), col, bg, lty, ### if user has set the point sizes if (!is.null(psize)) { - if (length(psize) == 1L) - psize <- rep(psize, x$k.all) + psize <- .expand1(psize, x$k.all) if (length(psize) != x$k.all) stop(mstyle$stop(paste0("Length of the 'psize' argument (", length(psize), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) psize <- .getsubset(psize, x$subset) @@ -118,8 +116,7 @@ add=x$add, to=x$to, transf, targs, pch=21, psize, plim=c(0.5,3.5), col, bg, lty, if (missing(col)) col <- par("fg") - if (length(col) == 1L) - col <- rep(col, x$k.all) + col <- .expand1(col, x$k.all) if (length(col) != x$k.all) stop(mstyle$stop(paste0("Length of the 'col' argument (", length(col), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -129,8 +126,7 @@ add=x$add, to=x$to, transf, targs, pch=21, psize, plim=c(0.5,3.5), col, bg, lty, if (missing(bg)) bg <- .coladj(par("bg","fg"), dark=0.35, light=-0.35) - if (length(bg) == 1L) - bg <- rep(bg, x$k.all) + bg <- .expand1(bg, x$k.all) if (length(bg) != x$k.all) stop(mstyle$stop(paste0("Length of the 'bg' argument (", length(bg), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) diff --git a/R/llplot.r b/R/llplot.r index 13d9e080f..36bd8e31c 100644 --- a/R/llplot.r +++ b/R/llplot.r @@ -194,30 +194,21 @@ lty, lwd, col, level=99.99, refline=0, ...) { ### if any of these arguments is not a single value, it must have the same length as the data before subsetting if (!is.null(lty)) { - if (length(lty) == 1L) { - lty <- rep(lty, k) - } else { - if (length(lty) != k) - stop(mstyle$stop(paste0("Length of 'lty' argument (", length(lty), ") does not match length of data (", k, ")."))) - } + lty <- .expand1(lty, k) + if (length(lty) != k) + stop(mstyle$stop(paste0("Length of 'lty' argument (", length(lty), ") does not match length of data (", k, ")."))) } if (!is.null(lwd)) { - if (length(lwd) == 1L) { - lwd <- rep(lwd, k) - } else { - if (length(lwd) != k) + lwd <- .expand1(lwd, k) + if (length(lwd) != k) stop(mstyle$stop(paste0("Length of 'lwd' argument (", length(lwd), ") does not match length of data (", k, ")."))) - } } if (!is.null(col)) { - if (length(col) == 1L) { - col <- rep(col, k) - } else { - if (length(col) != k) - stop(mstyle$stop(paste0("Length of 'col' argument (", length(col), ") does not match length of data (", k, ")."))) - } + col <- .expand1(col, k) + if (length(col) != k) + stop(mstyle$stop(paste0("Length of 'col' argument (", length(col), ") does not match length of data (", k, ")."))) } ### if a subset of studies is specified diff --git a/R/misc.func.hidden.mv.r b/R/misc.func.hidden.mv.r index 6f41f4b6d..1d3ca76ac 100644 --- a/R/misc.func.hidden.mv.r +++ b/R/misc.func.hidden.mv.r @@ -167,13 +167,11 @@ ### allow quickly setting all tau2 values to a fixed value - if (length(tau2) == 1L) - tau2 <- rep(tau2, tau2s) + tau2 <- .expand1(tau2, tau2s) ### allow quickly setting all rho values to a fixed value - if (length(rho) == 1L) - rho <- rep(rho, rhos) + rho <- .expand1(rho, rhos) ### check if tau2 and rho are of correct length @@ -1361,8 +1359,7 @@ if (is.numeric(dfs)) { ddf <- dfs - if (length(ddf) == 1L) - ddf <- rep(ddf, p) + ddf <- .expand1(ddf, p) if (length(ddf) != p) stop(mstyle$stop(paste0("Length of 'dfs' argument (", length(dfs), ") does not match the number of model coefficient (", p, ").")), call.=FALSE) } diff --git a/R/misc.func.hidden.r b/R/misc.func.hidden.r index 1153544a2..359738857 100644 --- a/R/misc.func.hidden.r +++ b/R/misc.func.hidden.r @@ -266,6 +266,12 @@ } +.expand1 <- function(x, k) { + if (length(x) == 1L) + x <- rep(x, k) + return(x) +} + ############################################################################ ### function to format p-values (no longer used; use fmtp() instead) diff --git a/R/plot.gosh.rma.r b/R/plot.gosh.rma.r index 716980db0..8b59459e3 100644 --- a/R/plot.gosh.rma.r +++ b/R/plot.gosh.rma.r @@ -24,8 +24,7 @@ xlim, ylim, xhist=TRUE, yhist=TRUE, hh=0.3, breaks, adjust, lwd, labels, ...) { trim <- ddd$trim if (!is.list(trim)) { - if (length(trim) == 1L) - trim <- rep(trim, ncol(x$res)-4L) + trim <- .expand1(trim, ncol(x$res)-4L) trim <- as.list(trim) } diff --git a/R/plot.profile.rma.r b/R/plot.profile.rma.r index 90e288b4c..d06fed4a7 100644 --- a/R/plot.profile.rma.r +++ b/R/plot.profile.rma.r @@ -91,8 +91,7 @@ plot.profile.rma <- function(x, xlim, ylim, pch=19, xlab, ylab, main, refline=TR if (missing.xlab) { xlab <- x[[j]]$xlab } else { - if (length(xlab) == 1L) - xlab <- rep(xlab, x$comps) + xlab <- .expand1(xlab, x$comps) } if (missing.ylab) { @@ -102,16 +101,13 @@ plot.profile.rma <- function(x, xlim, ylim, pch=19, xlab, ylab, main, refline=TR ylab <- paste0(ifelse(x$method=="REML", "Restricted ", ""), "Log-Likelihood") } } else { - if (length(ylab) == 1L) - ylab <- rep(ylab, x$comps) + ylab <- .expand1(ylab, x$comps) } if (missing.main) { main <- x[[j]]$title } else { - if (length(main) == 1L) { - main <- rep(main, x$comps) - } + main <- .expand1(main, x$comps) } lplot(x[[j]], xlim=xlim, ylim=ylim, pch=pch, diff --git a/R/predict.rma.ls.r b/R/predict.rma.ls.r index 213517e22..3d300bdee 100644 --- a/R/predict.rma.ls.r +++ b/R/predict.rma.ls.r @@ -358,8 +358,7 @@ level, digits, transf, targs, vcov=FALSE, ...) { newvi <- 0 } else { newvi <- ddd$newvi - if (length(newvi) == 1L) - newvi <- rep(newvi, k.new) + newvi <- .expand1(newvi, k.new) if (length(newvi) != k.new) stop(mstyle$stop(paste0("Length of 'newvi' argument (", length(newvi), ") does not match the number of predicted values (", k.new, ")."))) } diff --git a/R/predict.rma.r b/R/predict.rma.r index 02411765f..a08ed680d 100644 --- a/R/predict.rma.r +++ b/R/predict.rma.r @@ -239,8 +239,7 @@ level, digits, transf, targs, vcov=FALSE, ...) { } ### allow quick setting of all levels - if (length(tau2.levels) == 1L) - tau2.levels <- rep(tau2.levels, k.new) + tau2.levels <- .expand1(tau2.levels, k.new) ### check length of tau2.levels argument if (length(tau2.levels) != k.new) @@ -280,8 +279,7 @@ level, digits, transf, targs, vcov=FALSE, ...) { } ### allow quick setting of all levels - if (length(gamma2.levels) == 1L) - gamma2.levels <- rep(gamma2.levels, k.new) + gamma2.levels <- .expand1(gamma2.levels, k.new) ### check length of gamma2.levels argument if (length(gamma2.levels) != k.new) @@ -387,8 +385,7 @@ level, digits, transf, targs, vcov=FALSE, ...) { newvi <- 0 } else { newvi <- ddd$newvi - if (length(newvi) == 1L) - newvi <- rep(newvi, k.new) + newvi <- .expand1(newvi, k.new) if (length(newvi) != k.new) stop(mstyle$stop(paste0("Length of 'newvi' argument (", length(newvi), ") does not match the number of predicted values (", k.new, ")."))) } diff --git a/R/profile.rma.ls.r b/R/profile.rma.ls.r index 9029859ac..0fb217ac0 100644 --- a/R/profile.rma.ls.r +++ b/R/profile.rma.ls.r @@ -182,13 +182,11 @@ profile.rma.ls <- function(fitted, alpha, ### apply alpha.min/alpha.max limits (if they exist) on vc.lb/vc.ub as well if (!is.null(x$control$alpha.min)) { - if (length(x$control$alpha.min) == 1L) - x$control$alpha.min <- rep(x$control$alpha.min, x$q) + x$control$alpha.min <- .expand1(x$control$alpha.min, x$q) vc.lb <- max(vc.lb, x$con$alpha.min[alpha]) } if (!is.null(x$control$alpha.max)) { - if (length(x$control$alpha.max) == 1L) - x$control$alpha.max <- rep(x$control$alpha.max, x$q) + x$control$alpha.max <- .expand1(x$control$alpha.max, x$q) vc.ub <- min(vc.ub, x$con$alpha.max[alpha]) } diff --git a/R/ranef.rma.uni.r b/R/ranef.rma.uni.r index db16766d8..b15526639 100644 --- a/R/ranef.rma.uni.r +++ b/R/ranef.rma.uni.r @@ -47,8 +47,7 @@ ranef.rma.uni <- function(object, level, digits, transf, targs, ...) { ### see Appendix in: Raudenbush, S. W., & Bryk, A. S. (1985). Empirical ### Bayes meta-analysis. Journal of Educational Statistics, 10(2), 75-98 - if (length(x$tau2.f) == 1L) - x$tau2.f <- rep(x$tau2.f, length(x$yi.f)) + x$tau2.f <- .expand1(x$tau2.f, length(x$yi.f)) li <- ifelse(is.infinite(x$tau2.f), 1, x$tau2.f / (x$tau2.f + x$vi.f)) diff --git a/R/regplot.rma.r b/R/regplot.rma.r index 5ec0e3ef5..a901a5fbd 100644 --- a/R/regplot.rma.r +++ b/R/regplot.rma.r @@ -128,8 +128,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { if (missing(lcol)) { lcol <- c(rep(par("fg"), 3), .coladj(par("bg","fg"), dark=0.5, light=-0.5)) } else { - if (length(lcol) == 1L) - lcol <- rep(lcol, 4L) + lcol <- .expand1(lcol, 4L) if (length(lcol) == 2L) lcol <- c(lcol[c(1,2,2)], .coladj(par("bg","fg"), dark=0.5, light=-0.5)) if (length(lcol) == 3L) @@ -139,8 +138,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { if (missing(lty)) { lty <- c("solid", "dashed", "dotted", "solid") } else { - if (length(lty) == 1L) - lty <- rep(lty, 4L) + lty <- .expand1(lty, 4L) if (length(lty) == 2L) lty <- c(lty[c(1,2,2)], "solid") if (length(lty) == 3L) @@ -150,8 +148,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { if (missing(lwd)) { lwd <- c(3,1,1,2) } else { - if (length(lwd) == 1L) - lwd <- rep(lwd, 4L) + lwd <- .expand1(lwd, 4L) if (length(lwd) == 2L) lwd <- c(lwd[c(1,2,2)], 2) if (length(lwd) == 3L) @@ -246,8 +243,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { ### so we have to apply the same subsetting (if necessary) and removing of NAs as was ### done during the model fitting (note: NAs are removed further below) - if (length(pch) == 1L) - pch <- rep(pch, x$k.all) + pch <- .expand1(pch, x$k.all) if (length(pch) != x$k.all) stop(mstyle$stop(paste0("Length of the 'pch' argument (", length(pch), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -272,8 +268,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { } else { - if (length(psize) == 1L) - psize <- rep(psize, x$k.all) + psize <- .expand1(psize, x$k.all) if (length(psize) != x$k.all) stop(mstyle$stop(paste0("Length of the 'psize' argument (", length(psize), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -284,16 +279,14 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { } - if (length(col) == 1L) - col <- rep(col, x$k.all) + col <- .expand1(col, x$k.all) if (length(col) != x$k.all) stop(mstyle$stop(paste0("Length of the 'col' argument (", length(col), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) col <- .getsubset(col, x$subset) - if (length(bg) == 1L) - bg <- rep(bg, x$k.all) + bg <- .expand1(bg, x$k.all) if (length(bg) != x$k.all) stop(mstyle$stop(paste0("Length of the 'bg' argument (", length(bg), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) @@ -319,8 +312,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) { #if (!is.logical(label)) # stop(mstyle$stop("Argument 'label' must be a logical vector (or a single character string).")) - if (length(label) == 1L) - label <- rep(label, x$k.all) + label <- .expand1(label, x$k.all) if (length(label) != x$k.all) stop(mstyle$stop(paste0("Length of the 'label' argument (", length(label), ") does not correspond to the size of the original dataset (", x$k.all, ")."))) diff --git a/R/replmiss.r b/R/replmiss.r index fd889b377..c0f23ec44 100644 --- a/R/replmiss.r +++ b/R/replmiss.r @@ -27,8 +27,7 @@ replmiss <- function(x, y, data) { ### in case user specifies a constant to use for replacement - if (length(y) == 1L) - y <- rep(y, length(x)) + y <- .expand1(y, length(x)) ### check that x and y are of the same length diff --git a/R/rma.mv.r b/R/rma.mv.r index 28fa610ad..b0b2bc638 100644 --- a/R/rma.mv.r +++ b/R/rma.mv.r @@ -418,8 +418,7 @@ cvvc=FALSE, sparse=FALSE, verbose=FALSE, digits, control, ...) { ### allow easy setting of W to a single value - if (length(W) == 1L) - W <- rep(W, k) + W <- .expand1(W, k) A <- diag(W, nrow=length(W), ncol=length(W)) @@ -922,8 +921,7 @@ cvvc=FALSE, sparse=FALSE, verbose=FALSE, digits, control, ...) { ### allow quickly setting all sigma2 values to a fixed value - if (length(sigma2) == 1L) - sigma2 <- rep(sigma2, sigma2s) + sigma2 <- .expand1(sigma2, sigma2s) ### check if sigma2 is of the correct length @@ -1718,16 +1716,11 @@ cvvc=FALSE, sparse=FALSE, verbose=FALSE, digits, control, ...) { ### expand initial values to correct length - if (length(con$sigma2.init) == 1L) - con$sigma2.init <- rep(con$sigma2.init, sigma2s) - if (length(con$tau2.init) == 1L) - con$tau2.init <- rep(con$tau2.init, tau2s) - if (length(con$rho.init) == 1L) - con$rho.init <- rep(con$rho.init, rhos) - if (length(con$gamma2.init) == 1L) - con$gamma2.init <- rep(con$gamma2.init, gamma2s) - if (length(con$phi.init) == 1L) - con$phi.init <- rep(con$phi.init, phis) + con$sigma2.init <- .expand1(con$sigma2.init, sigma2s) + con$tau2.init <- .expand1(con$tau2.init, tau2s) + con$rho.init <- .expand1(con$rho.init, rhos) + con$gamma2.init <- .expand1(con$gamma2.init, gamma2s) + con$phi.init <- .expand1(con$phi.init, phis) ### checks on initial values set by the user (the initial values computed by the function are replaced by the user defined ones at this point) @@ -1758,8 +1751,7 @@ cvvc=FALSE, sparse=FALSE, verbose=FALSE, digits, control, ...) { ### in case user manually sets con$cholesky and specifies only a single value - if (length(con$cholesky) == 1L) - con$cholesky <- rep(con$cholesky, 2L) + con$cholesky <- .expand1(con$cholesky, 2L) ### use of Cholesky factorization only applicable for models with "UN", "UNR", and "GEN" structure diff --git a/R/rma.uni.r b/R/rma.uni.r index 4f8186f80..b85745beb 100644 --- a/R/rma.uni.r +++ b/R/rma.uni.r @@ -336,8 +336,7 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) { ### allow easy setting of vi to a single value - if (length(vi) == 1L) - vi <- rep(vi, k) # note: k is number of outcomes before subsetting + vi <- .expand1(vi, k) # note: k is number of outcomes before subsetting ### check length of yi and vi @@ -741,8 +740,7 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) { ### allow easy setting of weights to a single value - if (length(weights) == 1L) - weights <- rep(weights, k) # note: k is number of outcomes before subsetting + weights <- .expand1(weights, k) # note: k is number of outcomes before subsetting ### check length of yi and weights (only if weights is not NULL) @@ -1812,8 +1810,7 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) { if (missing(alpha) || is.null(alpha) || all(is.na(alpha))) { alpha <- rep(NA_real_, q) } else { - if (length(alpha) == 1L) - alpha <- rep(alpha, q) + alpha <- .expand1(alpha, q) if (length(alpha) != q) stop(mstyle$stop(paste0("Length of 'alpha' argument (", length(alpha), ") does not match actual number of parameters (", q, ")."))) } @@ -1825,8 +1822,7 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) { if (missing(beta) || is.null(beta) || all(is.na(beta))) { beta <- rep(NA_real_, p) } else { - if (length(beta) == 1L) - beta <- rep(beta, p) + beta <- .expand1(beta, p) if (length(beta) != p) stop(mstyle$stop(paste0("Length of 'beta' argument (", length(beta), ") does not match actual number of parameters (", p, ")."))) } @@ -1951,11 +1947,8 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) { ### set potential constraints on alpha values - if (length(con$alpha.min) == 1L) - con$alpha.min <- rep(con$alpha.min, q) - - if (length(con$alpha.max) == 1L) - con$alpha.max <- rep(con$alpha.max, q) + con$alpha.min <- .expand1(con$alpha.min, q) + con$alpha.max <- .expand1(con$alpha.max, q) if (length(con$alpha.min) != q) stop(mstyle$stop(paste0("Length of 'alpha.min' argument (", length(alpha.min), ") does not match actual number of parameters (", q, ")."))) diff --git a/R/selmodel.rma.uni.r b/R/selmodel.rma.uni.r index 0608948d9..d1aabd848 100644 --- a/R/selmodel.rma.uni.r +++ b/R/selmodel.rma.uni.r @@ -692,8 +692,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, delta, steps, if (missing(delta)) { delta <- rep(NA_real_, deltas) } else { - if (length(delta) == 1L) - delta <- rep(delta, deltas) + delta <- .expand1(delta, deltas) if (length(delta) != deltas) stop(mstyle$stop(paste0("Argument 'delta' should be of length ", deltas, " for this type of selection model."))) for (j in seq_len(deltas)) { @@ -724,8 +723,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, delta, steps, if (!is.null(con$delta.min)) delta.min <- con$delta.min - if (length(delta.min) == 1L) - delta.min <- rep(delta.min, deltas) + delta.min <- .expand1(delta.min, deltas) if (length(delta.min) != deltas) stop(mstyle$stop(paste0("Argument 'delta.min' should be of length ", deltas, " for this type of selection model."))) if (anyNA(delta.min)) @@ -748,8 +746,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, delta, steps, if (!is.null(con$delta.max)) delta.max <- con$delta.max - if (length(delta.max) == 1L) - delta.max <- rep(delta.max, deltas) + delta.max <- .expand1(delta.max, deltas) if (length(delta.max) != deltas) stop(mstyle$stop(paste0("Argument 'delta.max' should be of length ", deltas, " for this type of selection model."))) if (anyNA(delta.max)) @@ -775,8 +772,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, delta, steps, if (!is.null(con$delta.init)) delta.init <- con$delta.init - if (length(delta.init) == 1L) - delta.init <- rep(delta.init, deltas) + delta.init <- .expand1(delta.init, deltas) if (length(delta.init) != deltas) stop(mstyle$stop(paste0("Argument 'delta.init' should be of length ", deltas, " for this type of selection model."))) if (anyNA(delta.init)) diff --git a/R/summary.escalc.r b/R/summary.escalc.r index bf60eba49..1b9fd47bd 100644 --- a/R/summary.escalc.r +++ b/R/summary.escalc.r @@ -71,8 +71,7 @@ H0=0, append=TRUE, replace=TRUE, level=95, olim, digits, transf, ...) { k <- length(yi) - if (length(H0) == 1L) - H0 <- rep(H0, k) + H0 <- .expand1(H0, k) ### compute sei, zi, and lower/upper CI bounds; when applying a transformation, compute the transformed outcome and CI bounds diff --git a/R/transf.r b/R/transf.r index 467f54aba..b3289819c 100644 --- a/R/transf.r +++ b/R/transf.r @@ -340,8 +340,7 @@ transf.rpbtorbis <- function(xi, pi) { if (missing(pi)) { pi <- 0.5 } else { - if (length(pi) == 1L) - pi <- rep(pi, length(xi)) + pi <- .expand1(pi, length(xi)) if (length(xi) != length(pi)) stop("Length of 'xi' does not match length of 'pi'.", call.=FALSE) } @@ -354,8 +353,7 @@ transf.rtorpb <- function(xi, pi) { if (missing(pi)) { pi <- 0.5 } else { - if (length(pi) == 1L) - pi <- rep(pi, length(xi)) + pi <- .expand1(pi, length(xi)) if (length(xi) != length(pi)) stop("Length of 'xi' does not match length of 'pi'.", call.=FALSE) } @@ -399,8 +397,7 @@ transf.rpbtod <- function(xi, n1i, n2i) { } transf.lnortord <- function(xi, pc) { - if (length(pc) == 1L) - pc <- rep(pc, length(xi)) + pc <- .expand1(pc, length(xi)) if (length(xi) != length(pc)) stop("Length of 'xi' does not match length of 'pc'.", call.=FALSE) if (any(pc < 0) || any(pc > 1)) @@ -409,8 +406,7 @@ transf.lnortord <- function(xi, pc) { } transf.lnortorr <- function(xi, pc) { - if (length(pc) == 1L) - pc <- rep(pc, length(xi)) + pc <- .expand1(pc, length(xi)) if (length(xi) != length(pc)) stop("Length of 'xi' does not match length of 'pc'.", call.=FALSE) if (any(pc < 0) || any(pc > 1)) diff --git a/R/zzz.r b/R/zzz.r index 2a76b1780..3291c16a4 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -1,6 +1,6 @@ .onAttach <- function(libname, pkgname) { - ver <- "4.7-10" + ver <- "4.7-11" loadmsg <- paste0("\nLoading the 'metafor' package (version ", ver, "). For an\nintroduction to the package please type: help(metafor)\n") diff --git a/README.md b/README.md index 45af22d4c..a55cbb3bb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ metafor: A Meta-Analysis Package for R [![R build status](https://github.com/wviechtb/metafor/workflows/R-CMD-check/badge.svg)](https://github.com/wviechtb/metafor/actions) [![Code Coverage](https://codecov.io/gh/wviechtb/metafor/branch/master/graph/badge.svg)](https://app.codecov.io/gh/wviechtb/metafor) [![CRAN Version](https://www.r-pkg.org/badges/version/metafor)](https://cran.r-project.org/package=metafor) -[![devel Version](https://img.shields.io/badge/devel-4.7--10-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version) +[![devel Version](https://img.shields.io/badge/devel-4.7--11-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version) [![Monthly Downloads](https://cranlogs.r-pkg.org/badges/metafor)](https://cranlogs.r-pkg.org/badges/metafor) [![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/metafor)](https://cranlogs.r-pkg.org/badges/grand-total/metafor) diff --git a/docs/404.html b/docs/404.html index 08c2da8c9..f837194d7 100644 --- a/docs/404.html +++ b/docs/404.html @@ -54,7 +54,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index d77004f3c..1711b6510 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/articles/index.html b/docs/articles/index.html index bbd92ed98..ae8c6184a 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/articles/pkgdown/diagram.html b/docs/articles/pkgdown/diagram.html index b655814b4..39ccb2023 100644 --- a/docs/articles/pkgdown/diagram.html +++ b/docs/articles/pkgdown/diagram.html @@ -55,7 +55,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/authors.html b/docs/authors.html index 90e8a95a0..d10ad2b6e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/index.html b/docs/index.html index 81ddff3fe..563fe69ac 100644 --- a/docs/index.html +++ b/docs/index.html @@ -55,7 +55,7 @@ metafor - 4.7-10 + 4.7-11 @@ -121,7 +121,7 @@
-

License: GPL (>=2) R build status Code Coverage CRAN Version devel Version Monthly Downloads Total Downloads

+

License: GPL (>=2) R build status Code Coverage CRAN Version devel Version Monthly Downloads Total Downloads

Description

diff --git a/docs/news/index.html b/docs/news/index.html index 5a1c83c27..74d26ebf7 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11
@@ -90,7 +90,7 @@

Changelog

- +
diff --git a/docs/reference/addpoly.html b/docs/reference/addpoly.html index 0fa82c5e2..d18a879af 100644 --- a/docs/reference/addpoly.html +++ b/docs/reference/addpoly.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/addpoly.predict.rma.html b/docs/reference/addpoly.predict.rma.html index 11bbe30db..ab1b62bc0 100644 --- a/docs/reference/addpoly.predict.rma.html +++ b/docs/reference/addpoly.predict.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/addpoly.rma.html b/docs/reference/addpoly.rma.html index b0cbe5ace..deb68adca 100644 --- a/docs/reference/addpoly.rma.html +++ b/docs/reference/addpoly.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/aggregate.escalc.html b/docs/reference/aggregate.escalc.html index 267bed933..fb37d9e29 100644 --- a/docs/reference/aggregate.escalc.html +++ b/docs/reference/aggregate.escalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/anova.rma.html b/docs/reference/anova.rma.html index a3c3cc942..6ead9e460 100644 --- a/docs/reference/anova.rma.html +++ b/docs/reference/anova.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/baujat.html b/docs/reference/baujat.html index 02e7e3434..e81a110af 100644 --- a/docs/reference/baujat.html +++ b/docs/reference/baujat.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/bldiag.html b/docs/reference/bldiag.html index 1a39cfc62..884d80e13 100644 --- a/docs/reference/bldiag.html +++ b/docs/reference/bldiag.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/blsplit.html b/docs/reference/blsplit.html index 2b9a9aac6..142e89422 100644 --- a/docs/reference/blsplit.html +++ b/docs/reference/blsplit.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/blup.html b/docs/reference/blup.html index 6f26e2f5b..1bfb80150 100644 --- a/docs/reference/blup.html +++ b/docs/reference/blup.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/coef.permutest.rma.uni.html b/docs/reference/coef.permutest.rma.uni.html index 2fad92cb3..2144631bb 100644 --- a/docs/reference/coef.permutest.rma.uni.html +++ b/docs/reference/coef.permutest.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/coef.rma.html b/docs/reference/coef.rma.html index c39f2dc6f..45bf590a8 100644 --- a/docs/reference/coef.rma.html +++ b/docs/reference/coef.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/confint.rma.html b/docs/reference/confint.rma.html index 3a28f1c6d..9a5459fbe 100644 --- a/docs/reference/confint.rma.html +++ b/docs/reference/confint.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/contrmat.html b/docs/reference/contrmat.html index b33d2f670..c07c896c1 100644 --- a/docs/reference/contrmat.html +++ b/docs/reference/contrmat.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/conv.2x2.html b/docs/reference/conv.2x2.html index 9cab41075..e925e8830 100644 --- a/docs/reference/conv.2x2.html +++ b/docs/reference/conv.2x2.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/conv.delta.html b/docs/reference/conv.delta.html index 3636eb17b..ec63e042d 100644 --- a/docs/reference/conv.delta.html +++ b/docs/reference/conv.delta.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/conv.fivenum.html b/docs/reference/conv.fivenum.html index 8447f6f54..b176759cf 100644 --- a/docs/reference/conv.fivenum.html +++ b/docs/reference/conv.fivenum.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/conv.wald.html b/docs/reference/conv.wald.html index 8ecac9b15..790ee6d76 100644 --- a/docs/reference/conv.wald.html +++ b/docs/reference/conv.wald.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/cumul.html b/docs/reference/cumul.html index 1f7705fb6..a620c055b 100644 --- a/docs/reference/cumul.html +++ b/docs/reference/cumul.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/dfround.html b/docs/reference/dfround.html index a38190764..45d409014 100644 --- a/docs/reference/dfround.html +++ b/docs/reference/dfround.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/emmprep.html b/docs/reference/emmprep.html index f734c7a63..570f64ff9 100644 --- a/docs/reference/emmprep.html +++ b/docs/reference/emmprep.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/escalc.html b/docs/reference/escalc.html index acacd7772..e5871e188 100644 --- a/docs/reference/escalc.html +++ b/docs/reference/escalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/fitstats.html b/docs/reference/fitstats.html index 40a84c46e..9a67605e4 100644 --- a/docs/reference/fitstats.html +++ b/docs/reference/fitstats.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/fitted.rma.html b/docs/reference/fitted.rma.html index 407422dec..0c1b2e913 100644 --- a/docs/reference/fitted.rma.html +++ b/docs/reference/fitted.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/forest.cumul.rma.html b/docs/reference/forest.cumul.rma.html index 9e9fe1fa6..a1771ec7d 100644 --- a/docs/reference/forest.cumul.rma.html +++ b/docs/reference/forest.cumul.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/forest.default.html b/docs/reference/forest.default.html index 224416823..9a1cecfcd 100644 --- a/docs/reference/forest.default.html +++ b/docs/reference/forest.default.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/forest.html b/docs/reference/forest.html index 9995aa21d..f892a253a 100644 --- a/docs/reference/forest.html +++ b/docs/reference/forest.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/forest.rma.html b/docs/reference/forest.rma.html index abc8d0b69..516214841 100644 --- a/docs/reference/forest.rma.html +++ b/docs/reference/forest.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/formatters.html b/docs/reference/formatters.html index fc7fdcef1..9545b9062 100644 --- a/docs/reference/formatters.html +++ b/docs/reference/formatters.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/formula.rma.html b/docs/reference/formula.rma.html index bbcfc497b..c9c8da00d 100644 --- a/docs/reference/formula.rma.html +++ b/docs/reference/formula.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 @@ -143,13 +143,13 @@

Examples

res <- rma(yi, vi, mods = ~ ablat + alloc, data=dat) formula(res, type="mods") #> ~ablat + alloc -#> <environment: 0x55d7333c3220> +#> <environment: 0x55dfafcd7d50> ### specify moderators via 'yi' argument res <- rma(yi ~ ablat + alloc, vi, data=dat) formula(res, type="yi") #> yi ~ ablat + alloc -#> <environment: 0x55d72f76a930> +#> <environment: 0x55dfab3a0ba8> diff --git a/docs/reference/fsn.html b/docs/reference/fsn.html index 14bbdee25..218986610 100644 --- a/docs/reference/fsn.html +++ b/docs/reference/fsn.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/funnel.html b/docs/reference/funnel.html index 91f84e67d..141a43284 100644 --- a/docs/reference/funnel.html +++ b/docs/reference/funnel.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/gosh.html b/docs/reference/gosh.html index 08217e3e5..38867dc78 100644 --- a/docs/reference/gosh.html +++ b/docs/reference/gosh.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/hc.html b/docs/reference/hc.html index b4095ccd5..19f1f8f07 100644 --- a/docs/reference/hc.html +++ b/docs/reference/hc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/index.html b/docs/reference/index.html index 769f02804..ca59f59f7 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/influence.rma.mv.html b/docs/reference/influence.rma.mv.html index e8b16712f..c40e9f829 100644 --- a/docs/reference/influence.rma.mv.html +++ b/docs/reference/influence.rma.mv.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/influence.rma.uni.html b/docs/reference/influence.rma.uni.html index 6a4c2240b..7ab1b0553 100644 --- a/docs/reference/influence.rma.uni.html +++ b/docs/reference/influence.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/labbe.html b/docs/reference/labbe.html index 85d6d98f4..a22a20d72 100644 --- a/docs/reference/labbe.html +++ b/docs/reference/labbe.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/leave1out.html b/docs/reference/leave1out.html index cfeb7a880..d0ef8bbc1 100644 --- a/docs/reference/leave1out.html +++ b/docs/reference/leave1out.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/llplot.html b/docs/reference/llplot.html index bac4f75e9..7d9158a2c 100644 --- a/docs/reference/llplot.html +++ b/docs/reference/llplot.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/matreg.html b/docs/reference/matreg.html index 7892e52e4..529e881f5 100644 --- a/docs/reference/matreg.html +++ b/docs/reference/matreg.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/metafor-package.html b/docs/reference/metafor-package.html index 868ab92fa..a0d90bcb5 100644 --- a/docs/reference/metafor-package.html +++ b/docs/reference/metafor-package.html @@ -31,7 +31,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/metafor.news.html b/docs/reference/metafor.news.html index 89c8e2042..950d02854 100644 --- a/docs/reference/metafor.news.html +++ b/docs/reference/metafor.news.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 @@ -115,7 +115,7 @@

References

Examples

# \dontrun{
 metafor.news()
-#>                  Changes in version 4.7-10 (2024-04-29)                 
+#>                  Changes in version 4.7-11 (2024-05-06)                 
 #> 
 #>   - rma.mv() now counts the number of levels of a random effect more
 #>     appropriately; this may trigger more often the check whether the
diff --git a/docs/reference/methods.anova.rma.html b/docs/reference/methods.anova.rma.html
index 0373405d7..5502058a2 100644
--- a/docs/reference/methods.anova.rma.html
+++ b/docs/reference/methods.anova.rma.html
@@ -29,7 +29,7 @@
       
       
         metafor
-        4.7-10
+        4.7-11
       
     
diff --git a/docs/reference/methods.confint.rma.html b/docs/reference/methods.confint.rma.html index caf772df9..495f1001b 100644 --- a/docs/reference/methods.confint.rma.html +++ b/docs/reference/methods.confint.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/methods.escalc.html b/docs/reference/methods.escalc.html index 28cebefe5..d441bb2f5 100644 --- a/docs/reference/methods.escalc.html +++ b/docs/reference/methods.escalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/methods.list.rma.html b/docs/reference/methods.list.rma.html index db09d47ca..0cff5df72 100644 --- a/docs/reference/methods.list.rma.html +++ b/docs/reference/methods.list.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/methods.matreg.html b/docs/reference/methods.matreg.html index b88d8e53f..1f719cc43 100644 --- a/docs/reference/methods.matreg.html +++ b/docs/reference/methods.matreg.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/methods.vif.rma.html b/docs/reference/methods.vif.rma.html index 7f0251342..ea22a8b04 100644 --- a/docs/reference/methods.vif.rma.html +++ b/docs/reference/methods.vif.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/mfopt.html b/docs/reference/mfopt.html index 2db6800d9..fa8f1fff1 100644 --- a/docs/reference/mfopt.html +++ b/docs/reference/mfopt.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/misc-models.html b/docs/reference/misc-models.html index 9cf0bb6c6..caf2c90de 100644 --- a/docs/reference/misc-models.html +++ b/docs/reference/misc-models.html @@ -31,7 +31,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/misc-options.html b/docs/reference/misc-options.html index e0fe15e8b..5555545b1 100644 --- a/docs/reference/misc-options.html +++ b/docs/reference/misc-options.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/misc-recs.html b/docs/reference/misc-recs.html index c06136003..7a8384e9b 100644 --- a/docs/reference/misc-recs.html +++ b/docs/reference/misc-recs.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/model.matrix.rma.html b/docs/reference/model.matrix.rma.html index 9ec6184f7..d8f959aa9 100644 --- a/docs/reference/model.matrix.rma.html +++ b/docs/reference/model.matrix.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/permutest.html b/docs/reference/permutest.html index 281f81259..221702072 100644 --- a/docs/reference/permutest.html +++ b/docs/reference/permutest.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.cumul.rma.html b/docs/reference/plot.cumul.rma.html index 983a7c055..eeb91e888 100644 --- a/docs/reference/plot.cumul.rma.html +++ b/docs/reference/plot.cumul.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.gosh.rma.html b/docs/reference/plot.gosh.rma.html index c10eaaad7..21ddb7118 100644 --- a/docs/reference/plot.gosh.rma.html +++ b/docs/reference/plot.gosh.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.infl.rma.uni.html b/docs/reference/plot.infl.rma.uni.html index fa2fe5733..62c918356 100644 --- a/docs/reference/plot.infl.rma.uni.html +++ b/docs/reference/plot.infl.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.permutest.rma.uni.html b/docs/reference/plot.permutest.rma.uni.html index 8a13d5b13..0db1008a9 100644 --- a/docs/reference/plot.permutest.rma.uni.html +++ b/docs/reference/plot.permutest.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.rma.html b/docs/reference/plot.rma.html index b8d33c55b..f75629ded 100644 --- a/docs/reference/plot.rma.html +++ b/docs/reference/plot.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.rma.uni.selmodel.html b/docs/reference/plot.rma.uni.selmodel.html index 6566f995a..6fbadd773 100644 --- a/docs/reference/plot.rma.uni.selmodel.html +++ b/docs/reference/plot.rma.uni.selmodel.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/plot.vif.rma.html b/docs/reference/plot.vif.rma.html index d1598c56f..0a42f3099 100644 --- a/docs/reference/plot.vif.rma.html +++ b/docs/reference/plot.vif.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/predict.rma.html b/docs/reference/predict.rma.html index 14af734c7..3dc748003 100644 --- a/docs/reference/predict.rma.html +++ b/docs/reference/predict.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.anova.rma.html b/docs/reference/print.anova.rma.html index 3358671a6..f573aaf4b 100644 --- a/docs/reference/print.anova.rma.html +++ b/docs/reference/print.anova.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.confint.rma.html b/docs/reference/print.confint.rma.html index 0a6ddc078..4a966a622 100644 --- a/docs/reference/print.confint.rma.html +++ b/docs/reference/print.confint.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.escalc.html b/docs/reference/print.escalc.html index d1061fe88..545938f0b 100644 --- a/docs/reference/print.escalc.html +++ b/docs/reference/print.escalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.fsn.html b/docs/reference/print.fsn.html index 6aab21d47..87f422268 100644 --- a/docs/reference/print.fsn.html +++ b/docs/reference/print.fsn.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.gosh.rma.html b/docs/reference/print.gosh.rma.html index 6d2b2e734..b5a39380c 100644 --- a/docs/reference/print.gosh.rma.html +++ b/docs/reference/print.gosh.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.hc.rma.uni.html b/docs/reference/print.hc.rma.uni.html index e4efa75ce..dce4faa09 100644 --- a/docs/reference/print.hc.rma.uni.html +++ b/docs/reference/print.hc.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.list.rma.html b/docs/reference/print.list.rma.html index 0fa41c501..4353829a4 100644 --- a/docs/reference/print.list.rma.html +++ b/docs/reference/print.list.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.matreg.html b/docs/reference/print.matreg.html index 180ea8be1..217e3f167 100644 --- a/docs/reference/print.matreg.html +++ b/docs/reference/print.matreg.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.permutest.rma.uni.html b/docs/reference/print.permutest.rma.uni.html index e69f0e68a..dad392a51 100644 --- a/docs/reference/print.permutest.rma.uni.html +++ b/docs/reference/print.permutest.rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.ranktest.rma.html b/docs/reference/print.ranktest.rma.html index fe9fe4062..c6451de96 100644 --- a/docs/reference/print.ranktest.rma.html +++ b/docs/reference/print.ranktest.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.regtest.rma.html b/docs/reference/print.regtest.rma.html index b7397c5d4..8486bad2e 100644 --- a/docs/reference/print.regtest.rma.html +++ b/docs/reference/print.regtest.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/print.rma.html b/docs/reference/print.rma.html index d0a8a59ae..d88356ab5 100644 --- a/docs/reference/print.rma.html +++ b/docs/reference/print.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/profile.rma.html b/docs/reference/profile.rma.html index 43ba362f9..c377c4f3f 100644 --- a/docs/reference/profile.rma.html +++ b/docs/reference/profile.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/qqnorm.rma.html b/docs/reference/qqnorm.rma.html index a044744fa..0c89caa66 100644 --- a/docs/reference/qqnorm.rma.html +++ b/docs/reference/qqnorm.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/radial.html b/docs/reference/radial.html index 54e8d5d40..04bb7997c 100644 --- a/docs/reference/radial.html +++ b/docs/reference/radial.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/ranef.html b/docs/reference/ranef.html index 56903b44f..d4ef33858 100644 --- a/docs/reference/ranef.html +++ b/docs/reference/ranef.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/ranktest.html b/docs/reference/ranktest.html index 636902c0c..3560f7527 100644 --- a/docs/reference/ranktest.html +++ b/docs/reference/ranktest.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rcalc.html b/docs/reference/rcalc.html index a791b2bb4..bfb376860 100644 --- a/docs/reference/rcalc.html +++ b/docs/reference/rcalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/regplot.html b/docs/reference/regplot.html index d8dc57482..58e796fff 100644 --- a/docs/reference/regplot.html +++ b/docs/reference/regplot.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/regtest.html b/docs/reference/regtest.html index c9789ad46..bf630a96d 100644 --- a/docs/reference/regtest.html +++ b/docs/reference/regtest.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/replmiss.html b/docs/reference/replmiss.html index 08bbb56ad..e223e61a7 100644 --- a/docs/reference/replmiss.html +++ b/docs/reference/replmiss.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/reporter.html b/docs/reference/reporter.html index 12415a2b2..8dba90afa 100644 --- a/docs/reference/reporter.html +++ b/docs/reference/reporter.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 @@ -185,12 +185,12 @@

Examples

### generate report reporter(res) #> -#> Directory for generating the report is: /tmp/RtmpGX9VeD +#> Directory for generating the report is: /tmp/RtmpiApxRb #> Copying references.bib and apa.csl to report directory ... #> Saving model object to report_res.rdata ... #> Creating report_res.rmd file ... #> Rendering report_res.rmd file ... -#> Generated /tmp/RtmpGX9VeD/report_res.html ... +#> Generated /tmp/RtmpiApxRb/report_res.html ... #> Opening report ...
diff --git a/docs/reference/residuals.rma.html b/docs/reference/residuals.rma.html index a21e98d5b..b0c3bf797 100644 --- a/docs/reference/residuals.rma.html +++ b/docs/reference/residuals.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rma.glmm.html b/docs/reference/rma.glmm.html index 6525c1ca6..dd6ece0ea 100644 --- a/docs/reference/rma.glmm.html +++ b/docs/reference/rma.glmm.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rma.mh.html b/docs/reference/rma.mh.html index 0b87ab4fe..6fc4940d2 100644 --- a/docs/reference/rma.mh.html +++ b/docs/reference/rma.mh.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rma.mv.html b/docs/reference/rma.mv.html index e5850a113..3ddfe3382 100644 --- a/docs/reference/rma.mv.html +++ b/docs/reference/rma.mv.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rma.peto.html b/docs/reference/rma.peto.html index 9bb390429..bb116b879 100644 --- a/docs/reference/rma.peto.html +++ b/docs/reference/rma.peto.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/rma.uni.html b/docs/reference/rma.uni.html index 89e4ea2af..40b47ce65 100644 --- a/docs/reference/rma.uni.html +++ b/docs/reference/rma.uni.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/robust.html b/docs/reference/robust.html index f5df0cdfe..2f2724b5a 100644 --- a/docs/reference/robust.html +++ b/docs/reference/robust.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/se.html b/docs/reference/se.html index de1fdeadb..ffaf743ad 100644 --- a/docs/reference/se.html +++ b/docs/reference/se.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/selmodel.html b/docs/reference/selmodel.html index c34c812dc..2de3b1b00 100644 --- a/docs/reference/selmodel.html +++ b/docs/reference/selmodel.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/simulate.rma.html b/docs/reference/simulate.rma.html index 1120c66a8..af9db336f 100644 --- a/docs/reference/simulate.rma.html +++ b/docs/reference/simulate.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/tes.html b/docs/reference/tes.html index a140f5594..296f19450 100644 --- a/docs/reference/tes.html +++ b/docs/reference/tes.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/to.long.html b/docs/reference/to.long.html index 0bfa01c11..ac7a1711f 100644 --- a/docs/reference/to.long.html +++ b/docs/reference/to.long.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/to.table.html b/docs/reference/to.table.html index 6c353cc5b..683887eb1 100644 --- a/docs/reference/to.table.html +++ b/docs/reference/to.table.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/to.wide.html b/docs/reference/to.wide.html index 3c997672b..4c00262db 100644 --- a/docs/reference/to.wide.html +++ b/docs/reference/to.wide.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/transf.html b/docs/reference/transf.html index a37532fda..d2988a36a 100644 --- a/docs/reference/transf.html +++ b/docs/reference/transf.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/trimfill.html b/docs/reference/trimfill.html index 8853be14a..cd6469ec6 100644 --- a/docs/reference/trimfill.html +++ b/docs/reference/trimfill.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/update.rma.html b/docs/reference/update.rma.html index 80ded9909..92d3b163f 100644 --- a/docs/reference/update.rma.html +++ b/docs/reference/update.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/vcalc.html b/docs/reference/vcalc.html index 9cef10d1b..ed2caf096 100644 --- a/docs/reference/vcalc.html +++ b/docs/reference/vcalc.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/vcov.rma.html b/docs/reference/vcov.rma.html index b0a9383b7..0dfc0e236 100644 --- a/docs/reference/vcov.rma.html +++ b/docs/reference/vcov.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/vec2mat.html b/docs/reference/vec2mat.html index 2830aed65..9ec1ed782 100644 --- a/docs/reference/vec2mat.html +++ b/docs/reference/vec2mat.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/vif.html b/docs/reference/vif.html index 878495fd4..305990b89 100644 --- a/docs/reference/vif.html +++ b/docs/reference/vif.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11 diff --git a/docs/reference/weights.rma.html b/docs/reference/weights.rma.html index e52b5f5a3..4954759c5 100644 --- a/docs/reference/weights.rma.html +++ b/docs/reference/weights.rma.html @@ -29,7 +29,7 @@ metafor - 4.7-10 + 4.7-11