wviechtb / metafor

A meta-analysis package for R
https://www.metafor-project.org
230 stars 52 forks source link

Pairwise function is not found #86

Closed shaheedazaad closed 3 months ago

shaheedazaad commented 3 months ago

Classification: Bug report

Summary

The pairwise function described in the metafor docs is not found,

Reproducible Example (if applicable)

library(metafor)

dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

res <- rma(yi, vi, mods = ~ factor(alloc) + year + ablat, data=dat, test="knha")

anova(res, X=pairwise(btt=1:3))

Produces

Error in pairwise(btt = 1:3) : could not find function "pairwise"

Notes

I've tried accessing pairwise via metafor:::pairwise, and searching for it with getAnywhere() to no avail. I don't see pairwise in metafor's NAMESPACE file on my machine - not sure if this is relevant.

sessionInfo()

R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS 15.0

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] metafor_4.6-0       numDeriv_2016.8-1.1 metadat_1.2-0       Matrix_1.7-0       

loaded via a namespace (and not attached):
 [1] digest_0.6.35     fastmap_1.2.0     xfun_0.44         lattice_0.22-6    knitr_1.47        htmltools_0.5.8.1 rmarkdown_2.27    mathjaxr_1.6-0    cli_3.6.2        
[10] grid_4.4.0        compiler_4.4.0    rstudioapi_0.16.0 tools_4.4.0       nlme_3.1-165      evaluate_0.24.0   yaml_2.3.9        rlang_1.1.4      
wviechtb commented 3 months ago

You need to install the development version (https://wviechtb.github.io/metafor/#installation).

shaheedazaad commented 3 months ago

You need to install the development version (https://wviechtb.github.io/metafor/#installation).

Ah, thank you!

wviechtb commented 2 months ago

Just to let you know, the function has been renamed to pairmat() to avoid a name clash with the pairwise() function from the meta/netmeta packages.