richarddmorey / BayesFactor

BayesFactor R package for Bayesian data analysis with common statistical models.
https://richarddmorey.github.io/BayesFactor/
131 stars 48 forks source link

`meta.ttestBF` example no longer works #158

Closed IndrajeetPatil closed 2 years ago

IndrajeetPatil commented 2 years ago

I am not sure why, but the meta.ttestBF example no longer works. I am working with development version (a664956d) of {BayesFactor} and R 4.1.1.

library(BayesFactor)
#> Loading required package: coda
#> Loading required package: Matrix
#> ************
#> Welcome to BayesFactor 0.9.12-4.3. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
#> 
#> Type BFManual() to open the manual.
#> ************

## Bem's (2010) data (see Rouder & Morey, 2011)
t=c(-.15,2.39,2.42,2.43)
N=c(100,150,97,99)

## Using rscale=1 and one-sided test to be
## consistent with Rouder & Morey (2011)
bf = meta.ttestBF(t, N, rscale=1, nullInterval=c(0, Inf))
#> Error in integrate(meta.t.like, lower = (lower - mean.delta)/scale.delta, : length(lower) == 1 is not TRUE

Created on 2021-10-16 by the reprex package (v2.0.1)

Session info ``` r sessioninfo::session_info() #> - Session info -------------------------------------------------------------- #> hash: person juggling: medium skin tone, man cook: medium-dark skin tone, woman mechanic: dark skin tone #> #> setting value #> version R version 4.1.1 (2021-08-10) #> os Windows 10 x64 (build 19043) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate English_United Kingdom.1252 #> ctype English_United Kingdom.1252 #> tz Europe/Berlin #> date 2021-10-16 #> pandoc 2.14.2 @ C:/PROGRA~1/Pandoc/ (via rmarkdown) #> #> - Packages ------------------------------------------------------------------- #> package * version date (UTC) lib source #> backports 1.2.1 2020-12-09 [1] CRAN (R 4.1.0) #> BayesFactor * 0.9.12-4.3 2021-10-04 [1] Github (richarddmorey/BayesFactor@a664956) #> cli 3.0.1 2021-07-17 [1] CRAN (R 4.1.0) #> coda * 0.19-4 2020-09-30 [1] CRAN (R 4.1.1) #> crayon 1.4.1 2021-02-08 [1] CRAN (R 4.1.1) #> digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.1) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.1) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.1) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.1) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.1) #> glue 1.4.2 2020-08-27 [1] CRAN (R 4.1.1) #> gtools 3.9.2 2021-06-06 [1] CRAN (R 4.1.1) #> highr 0.9 2021-04-16 [1] CRAN (R 4.1.1) #> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.1) #> knitr 1.36.3 2021-10-09 [1] Github (yihui/knitr@00469e0) #> lattice 0.20-44 2021-05-02 [2] CRAN (R 4.1.1) #> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.1) #> Matrix * 1.3-4 2021-06-01 [2] CRAN (R 4.1.1) #> MatrixModels 0.5-0 2021-03-02 [1] CRAN (R 4.1.1) #> mvtnorm 1.1-3 2021-10-08 [1] CRAN (R 4.1.1) #> pbapply 1.5-0 2021-09-16 [1] CRAN (R 4.1.1) #> pillar 1.6.3 2021-09-26 [1] CRAN (R 4.1.1) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.1) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.1) #> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.1.1) #> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.1.0) #> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.1.0) #> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.1.1) #> Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.1.1) #> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.1.1) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.1.1) #> rmarkdown 2.11.3 2021-10-09 [1] Github (rstudio/rmarkdown@5a3e941) #> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.1) #> sessioninfo 1.1.1.9000 2021-10-13 [1] Github (r-lib/sessioninfo@43a85d5) #> stringi 1.7.5 2021-10-04 [1] CRAN (R 4.1.1) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.1) #> styler 1.6.2.9000 2021-10-10 [1] Github (r-lib/styler@2ab0e65) #> tibble 3.1.5 2021-09-30 [1] CRAN (R 4.1.1) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.1) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.1) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.1) #> xfun 0.26 2021-09-14 [1] CRAN (R 4.1.1) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) #> #> [1] C:/Users/IndrajeetPatil/Documents/R/win-library/4.1 #> [2] C:/Program Files/R/R-4.1.1/library #> #> ------------------------------------------------------------------------------ ```
richarddmorey commented 2 years ago

I'll check on this; it was likely due to a change to make the underlying integration more stable.

richarddmorey commented 2 years ago

Just pushed a fix; let me know if you have any further issues.

IndrajeetPatil commented 2 years ago

That fixed it. Thanks for the quick reply!