Skip to content

Commit

Permalink
Minor fixes to the dynamic theming of plots.
Browse files Browse the repository at this point in the history
  • Loading branch information
wviechtb committed Oct 22, 2023
1 parent 6713244 commit 23f5bc1
Show file tree
Hide file tree
Showing 191 changed files with 183 additions and 169 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metafor
Version: 4.5-0
Date: 2023-10-01
Version: 4.5-1
Date: 2023-10-22
Title: Meta-Analysis Package for R
Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-3463-4063"))
Depends: R (>= 4.0.0), methods, Matrix, metadat, numDeriv
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# metafor 4.5-0 (2023-10-01)
# metafor 4.5-1 (2023-10-22)

- bump for devel version
- a few minor fixes to the dynamic theming of plots based on the foreground and background colors of the plotting device

# metafor 4.4-0 (2023-09-27)

Expand Down
4 changes: 2 additions & 2 deletions R/anova.rma.r
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE,
ddf <- cs.lc$df

if (!missing(rhs))
warning(mstyle$warning("Cannot use 'rhs' argument for 'robust.rma' objects based on 'clubSandwich'."))
warning(mstyle$warning("Cannot use 'rhs' argument for 'robust.rma' objects based on 'clubSandwich'."), call.=FALSE)

rhs <- rep(0, m)

Expand Down Expand Up @@ -504,7 +504,7 @@ anova.rma <- function(object, object2, btt, X, att, Z, rhs, digits, refit=FALSE,
### for LRTs, using anything besides ML/REML is strictly speaking incorrect

if (test == "LRT" && (!is.element(model.f$method, c("FE","EE","CE","ML","REML")) || !is.element(model.r$method, c("FE","EE","CE","ML","REML"))))
warning(mstyle$warning("LRTs should be based on ML/REML estimation."))
warning(mstyle$warning("LRTs should be based on ML/REML estimation."), call.=FALSE)

### for LRTs based on REML estimation, check if fixed effects differ
if (test == "LRT" && model.f$method == "REML" && (!identical(model.f$X, model.r$X))) {
Expand Down
2 changes: 1 addition & 1 deletion R/emmprep.r
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ emmprep <- function(x, verbose=FALSE, ...) {

if (is.null(ddd$tran)) {

if (is.element(x$measure, c("RR","OR","MPORM","PETO","MPRR","MPOR","MPORC","MPPETO","IRR","ROM","D2OR","D2ORL","D2ORN","CVR","VR","PLN","IRLN","SDLN","MNLN","CVLN","ROMC","CVRC","VRC","REH"))) {
if (is.element(x$measure, c("RR","OR","MPORM","PETO","MPRR","MPOR","MPORC","MPPETO","IRR","ROM","D2OR","D2ORL","D2ORN","CVR","VR","PLN","IRLN","SDLN","MNLN","CVLN","ROMC","CVRC","VRC","REH","HRR"))) {
out@misc$tran <- "log"
#out@misc$tran <- emmeans::make.tran("genlog", 0)
#out <- update(out, emmeans::make.tran("genlog", 0))
Expand Down
1 change: 1 addition & 0 deletions R/escalc.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data, slab, subset, include, add=1/2, to="only0", drop00=FALSE, vtype="LS", var.
"MC","SMCC","SMCR","SMCRH","ROMC","CVRC","VRC", # raw/standardized mean change, log(ROM), CVR, and VR for dependent samples
"ARAW","AHW","ABT", # alpha (and transformations thereof)
"REH", # relative excess heterozygosity
"HRR","HRD", # hazard rate ratios and differences
"GEN")))
stop(mstyle$stop("Unknown 'measure' specified."))

Expand Down
12 changes: 6 additions & 6 deletions R/funnel.default.r
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {
shade <- rep(shade, length(level))

if (missing(hlines))
hlines <- par("bg")
hlines <- .coladj(par("bg","fg"), dark=c(0,-0.9), light=c(0,1))

if (is.null(refline))
refline <- NA
Expand Down Expand Up @@ -592,11 +592,6 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {

#########################################################################

### add L-shaped box around plot

if (!is.na(colbox))
box(bty="l", col=colbox)

### generate x-axis positions if none are specified

if (is.null(at)) {
Expand Down Expand Up @@ -624,6 +619,11 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {

laxis(side=1, at=at, labels=at.lab, ...)

### add L-shaped box around plot

if (!is.na(colbox))
box(bty="l", col=colbox)

############################################################################

### labeling of points
Expand Down
12 changes: 6 additions & 6 deletions R/funnel.rma.r
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {
shade <- rep(shade, length(level))

if (missing(hlines))
hlines <- par("bg")
hlines <- .coladj(par("bg","fg"), dark=c(0,-0.8), light=c(0,1))

if (!missing(refline) && is.null(refline))
refline <- NA
Expand Down Expand Up @@ -639,11 +639,6 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {

#########################################################################

### add L-shaped box around plot

if (!is.na(colbox))
box(bty="l", col=colbox)

### generate x-axis positions if none are specified

if (is.null(at)) {
Expand Down Expand Up @@ -671,6 +666,11 @@ label=FALSE, offset=0.4, legend=FALSE, ...) {

laxis(side=1, at=at, labels=at.lab, ...)

### add L-shaped box around plot

if (!is.na(colbox))
box(bty="l", col=colbox)

############################################################################

### labeling of points
Expand Down
2 changes: 1 addition & 1 deletion R/misc.func.hidden.funnel.r
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
y = NULL,
inset = 0.01,
bty = "o",
bg = .coladj(par("bg","fg"), dark=0.00, light=0.00), # avoids a transparent background
bg = .coladj(par("bg","fg"), dark=c(0,-0.9), light=c(0,0.9)),
studies = TRUE,
show = "pvals",
cex = c(1,2,1),
Expand Down
21 changes: 21 additions & 0 deletions R/misc.func.hidden.r
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,26 @@
}
}
######################################################################
if (measure == "HRR") {
if (identical(transf.char, "FALSE") && identical(atransf.char, "FALSE")) {
lab <- ifelse(short, "Log[HR]", "Log Hazard Ratio")
} else {
lab <- ifelse(short, lab, "Transformed Log Hazard Ratio")
funlist <- lapply(list(exp, transf.exp.int), deparse)
if (any(sapply(funlist, identical, atransf.char)))
lab <- ifelse(short, "REH", "Hazard Ratio (log scale)")
if (any(sapply(funlist, identical, transf.char)))
lab <- ifelse(short, "REH", "Hazard Ratio")
}
}
if (measure == "HRD") {
if (identical(transf.char, "FALSE") && identical(atransf.char, "FALSE")) {
lab <- ifelse(short, "HR Difference", "Hazard Rate Difference")
} else {
lab <- ifelse(short, lab, "Transformed Hazard Rate Difference")
}
}
######################################################################

}

Expand Down Expand Up @@ -1854,6 +1874,7 @@
} else {
col <- col + round(light*255)[[pos]]
}

col[col < 0] <- 0
col[col > 255] <- 255

Expand Down
2 changes: 1 addition & 1 deletion R/plot.permutest.rma.uni.r
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ plot.permutest.rma.uni <- function(x, beta, alpha, QM=FALSE, QS=FALSE,
ltys <- ltys[lwds > 0]
#pchs <- pchs[lwds > 0]
lwds <- lwds[lwds > 0]
legend(lpos, inset=.01, bg=par("bg"), lwd=lwds, col=lcols, lty=ltys, legend=ltxt)
legend(lpos, inset=.01, bg=.coladj(par("bg"), dark=0, light=0), lwd=lwds, col=lcols, lty=ltys, legend=ltxt)

}

Expand Down
2 changes: 1 addition & 1 deletion R/regplot.rma.r
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ lcol, lwd, lty, legend=FALSE, xvals, ...) {
}

if (length(ltxt) >= 1L)
legend(lpos, inset=.01, bg=par("bg"), pch=pch.l, col=col.l, pt.bg=bg.l, lty=lty.l, lwd=lwd.l, text.col=tcol.l, pt.cex=1.5, seg.len=3, legend=ltxt, box.lty=box.lty)
legend(lpos, inset=.01, bg=.coladj(par("bg"), dark=0, light=0), pch=pch.l, col=col.l, pt.bg=bg.l, lty=lty.l, lwd=lwd.l, text.col=tcol.l, pt.cex=1.5, seg.len=3, legend=ltxt, box.lty=box.lty)

pch.l <- NULL
col.l <- NULL
Expand Down
1 change: 1 addition & 0 deletions R/rma.uni.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) {
"MC","SMCC","SMCR","SMCRH","ROMC","CVRC","VRC", # raw/standardized mean change, log(ROM), CVR, and VR for dependent samples
"ARAW","AHW","ABT", # alpha (and transformations thereof)
"REH", # relative excess heterozygosity
"HRR","HRD", # hazard rate ratios and differences
"GEN")))
stop(mstyle$stop("Unknown 'measure' specified."))

Expand Down
2 changes: 1 addition & 1 deletion R/zzz.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.onAttach <- function(libname, pkgname) {

ver <- "4.5-0"
ver <- "4.5-1"

loadmsg <- paste0("\nLoading the 'metafor' package (version ", ver, "). For an\nintroduction to the package please type: help(metafor)\n")

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.5--0-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version)
[![devel Version](https://img.shields.io/badge/devel-4.5--1-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)

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/ISSUE_TEMPLATE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/pkgdown/diagram.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
diagram: pkgdown/diagram.html
last_built: 2023-10-01T10:20Z
last_built: 2023-10-22T14:05Z
urls:
reference: https://wviechtb.github.io/metafor/reference
article: https://wviechtb.github.io/metafor/articles
Expand Down
Binary file modified docs/reference/Rplot002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/addpoly.default.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addpoly.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addpoly.predict.rma.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addpoly.rma.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/aggregate.escalc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/anova.rma.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/baujat.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/bldiag.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/blsplit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 23f5bc1

Please sign in to comment.