diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 33e399a..ecb5304 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,3 +1,5 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions on: push: branches: @@ -22,84 +24,64 @@ jobs: fail-fast: false matrix: config: - # - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } + # - {os: macOS-11.6.2, r: 'release'} # the release C++ version does not compile properly env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_REMOTES_NO_ERRORS_FROM_WARNINGS: false - NOT_CRAN: true steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 with: r-version: ${{ matrix.config.r }} - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v1 - name: Query dependencies run: | install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - name: Restore R package cache + uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - name: Set path for RTools 4.0 - if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - - name: Install most Windows system dependencies - if: runner.os == 'Windows' + - name: Install system dependencies + if: runner.os == 'Linux' run: | - pacman -Syu mingw-w64-x86_64-make --noconfirm - g++ --version - Get-Command g++ | Select-Object -ExpandProperty Definition - mingw32-make --version - Get-Command mingw32-make | Select-Object -ExpandProperty Definition - (New-Object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe', 'C:\JAGS-4.3.1.exe') - shell: powershell - - - name: Install JAGS on Windows + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Install JAGS (windows-latest) if: runner.os == 'Windows' - run: C:\JAGS-4.3.1.exe /S + run: | + curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.1.exe + wjags.exe /S + del wjags.exe shell: cmd - - name: Install Linux system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - sudo apt-get install -y libglpk-dev - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - sudo -s apt-get install jags - sudo -s apt-get install libv8-dev - sudo -s apt-get install libnode-dev - sudo -s apt-get install libcurl4-openssl-dev - - - name: Install Mac system dependencies + - name: Install JAGS (macOS-latest) if: runner.os == 'macOS' - run: | - brew install jags - brew install libgit2 - + run : | + rm '/usr/local/bin/gfortran' + brew install automake jags + - name: Install dependencies run: | - remotes::install_deps(dependencies = TRUE, type = ifelse(tolower(Sys.info()["sysname"]) == "linux", "source", "binary")) + remotes::install_deps(dependencies = TRUE) remotes::install_cran("rcmdcheck") shell: Rscript {0} @@ -108,6 +90,7 @@ jobs: env: _R_CHECK_CRAN_INCOMING_REMOTE_: false run: | + options(crayon.enabled = TRUE) rcmdcheck::rcmdcheck( args = c("--no-manual", "--as-cran", "--ignore-vignettes"), build_args = c("--no-build-vignettes"), @@ -122,12 +105,14 @@ jobs: JAGS_ROOT: "/c/progra~1/JAGS/JAGS-4.3.1" JAGS_MAJOR_VERSION: 4 run: | + options(crayon.enabled = TRUE) rcmdcheck::rcmdcheck( args = c("--no-manual", "--as-cran", "--ignore-vignettes"), build_args = c("--no-build-vignettes"), error_on = "warning", check_dir = "check") - shell: Rscript {0}" + shell: Rscript {0} + - name: Upload check results if: failure() diff --git a/.github/workflows/R-CMD-tests.yaml b/.github/workflows/R-CMD-tests.yaml index 36cd680..fb89081 100644 --- a/.github/workflows/R-CMD-tests.yaml +++ b/.github/workflows/R-CMD-tests.yaml @@ -24,96 +24,71 @@ jobs: fail-fast: false matrix: config: - # - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + # - {os: macOS-11.6.2, r: 'release'} # the release C++ version does not compile properly env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - NOT_CRAN: true steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 with: r-version: ${{ matrix.config.r }} - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v1 - name: Query dependencies run: | install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - name: Restore R package cache + uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - name: Set path for RTools 4.0 - if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - - name: Install most Windows system dependencies - if: runner.os == 'Windows' + - name: Install system dependencies + if: runner.os == 'Linux' run: | - pacman -Syu mingw-w64-x86_64-make --noconfirm - g++ --version - Get-Command g++ | Select-Object -ExpandProperty Definition - mingw32-make --version - Get-Command mingw32-make | Select-Object -ExpandProperty Definition - (New-Object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe', 'C:\JAGS-4.3.1.exe') - shell: powershell + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - name: Install JAGS on Windows + - name: Install JAGS (windows-latest) if: runner.os == 'Windows' - run: C:\JAGS-4.3.1.exe /S - shell: cmd - - - name: Install Linux system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | - sudo apt-get install -y libglpk-dev - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - sudo -s apt-get install jags - sudo -s apt-get install libv8-dev - sudo -s apt-get install libnode-dev - sudo -s apt-get install libcurl4-openssl-dev + curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.1.exe + wjags.exe /S + del wjags.exe + shell: cmd - - name: Install Mac system dependencies + - name: Install JAGS (macOS-latest) if: runner.os == 'macOS' + run : | + rm '/usr/local/bin/gfortran' + brew install automake jags + + - name: Install and test RoBSA (non-Windows) + if: runner.os != 'Windows' + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false run: | - brew install jags - brew install libgit2 - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE, type = ifelse(tolower(Sys.info()["sysname"]) == "linux", "source", "binary")) + remotes::install_deps(dependencies = TRUE) remotes::install_cran("rcmdcheck") install.packages("devtools") install.packages("testthat") install.packages("vdiffr") devtools::install() - shell: Rscript {0} - - - name: Install and test RoBSA (non-Windows) - if: runner.os != 'Windows' - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: library(vdiffr) library(testthat) devtools::test() @@ -125,7 +100,13 @@ jobs: _R_CHECK_CRAN_INCOMING_REMOTE_: false JAGS_ROOT: "/c/progra~1/JAGS/JAGS-4.3.1" JAGS_MAJOR_VERSION: 4 - run: + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + install.packages("devtools") + install.packages("testthat") + install.packages("vdiffr") + devtools::install() library(vdiffr) library(testthat) devtools::test() diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 9e44fe1..e07c0f4 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: config: - - {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -62,7 +62,7 @@ jobs: - name: Install JAGS (windows-latest) if: runner.os == 'Windows' run: | - curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe + curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.1.exe wjags.exe /S del wjags.exe shell: cmd @@ -77,8 +77,6 @@ jobs: run: | remotes::install_deps(dependencies = TRUE) install.packages("pkgdown") - #remotes::install_version("BayesTools", "0.2.10") - remotes::install_github("FBartos/BayesTools@v0.2.10") shell: Rscript {0} - name: Install package diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index b9ee825..c6abe71 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -3,10 +3,12 @@ on: branches: - main - master + - pre-release pull_request: branches: - main - master + - pre-release name: test-coverage @@ -20,85 +22,60 @@ jobs: fail-fast: false matrix: config: - # - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - # - {os: ubuntu-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: - RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_REMOTES_NO_ERRORS_FROM_WARNINGS: false - NOT_CRAN: true steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 with: r-version: ${{ matrix.config.r }} - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v1 - name: Query dependencies run: | install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - name: Restore R package cache + uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - name: Set path for RTools 4.0 - if: runner.os == 'Windows' - run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - - name: Install most Windows system dependencies - if: runner.os == 'Windows' + - name: Install system dependencies + if: runner.os == 'Linux' run: | - pacman -Syu mingw-w64-x86_64-make --noconfirm - g++ --version - Get-Command g++ | Select-Object -ExpandProperty Definition - mingw32-make --version - Get-Command mingw32-make | Select-Object -ExpandProperty Definition - (New-Object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe', 'C:\JAGS-4.3.1.exe') - shell: powershell + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - name: Install JAGS on Windows + - name: Install JAGS (windows-latest) if: runner.os == 'Windows' - run: C:\JAGS-4.3.1.exe /S - shell: cmd - - - name: Install Linux system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | - sudo apt-get install -y libglpk-dev - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - sudo -s apt-get install jags - sudo -s apt-get install libv8-dev - sudo -s apt-get install libnode-dev - sudo -s apt-get install libcurl4-openssl-dev + curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.1.exe + wjags.exe /S + del wjags.exe + shell: cmd - - name: Install Mac system dependencies + - name: Install JAGS (macOS-latest) if: runner.os == 'macOS' - run: | - brew install jags - brew install libgit2 - + run : | + rm '/usr/local/bin/gfortran' + brew install automake jags + - name: Install dependencies run: | - remotes::install_deps(dependencies = TRUE, type = ifelse(tolower(Sys.info()["sysname"]) == "linux", "source", "binary")) - remotes::install_cran("rcmdcheck") + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) remotes::install_cran("covr") shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 4f31237..3207645 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: RoBSA Type: Package Title: Robust Bayesian Survival Analysis -Version: 1.0.0 +Version: 1.0.1 Maintainer: František Bartoš Authors@R: c( person("František", "Bartoš", role = c("aut", "cre"), @@ -29,8 +29,8 @@ License: GPL-3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 -SystemRequirements: JAGS >= 4.3.0 (https://mcmc-jags.sourceforge.io/) +RoxygenNote: 7.2.3 +SystemRequirements: JAGS >= 4.3.1 (https://mcmc-jags.sourceforge.io/) Depends: R (>= 4.0.0) Imports: @@ -38,11 +38,11 @@ Imports: survival, rjags, runjags, - bridgesampling, scales, coda, stats, graphics, + rlang, Rdpack Suggests: parallel, @@ -51,5 +51,6 @@ Suggests: testthat, vdiffr, knitr, - rmarkdown + rmarkdown, + covr RdMacros: Rdpack diff --git a/NAMESPACE b/NAMESPACE index be33cea..36ca886 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -92,4 +92,6 @@ export(weibull_aft_q) export(weibull_aft_r) export(weibull_aft_sd) export(weibull_aft_survival) +importFrom(Rdpack,reprompt) +importFrom(rlang,.data) importFrom(survival,Surv) diff --git a/NEWS.md b/NEWS.md index 5173b4a..f792e6a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,2 +1,8 @@ +## version 1.0.1 +### changes +- update to R 4.2 and JAGS 4.3.1 +- suppressing start-up message +- cleaning up imports + ## version 1.0.0 This is a release version of the package. Please note that it is incompatible to the previous osf version and it is not possible to exactly reproduce previous output. diff --git a/R/RoBSA-package.R b/R/RoBSA-package.R index 747e964..e062eaf 100644 --- a/R/RoBSA-package.R +++ b/R/RoBSA-package.R @@ -17,4 +17,6 @@ #' #' @references \insertAllCited{} #' @importFrom survival Surv +#' @importFrom Rdpack reprompt +#' @importFrom rlang .data "_PACKAGE" diff --git a/R/main.R b/R/main.R index 59ca813..f92ec56 100644 --- a/R/main.R +++ b/R/main.R @@ -14,10 +14,9 @@ #' to be tested with Bayesian model-averaged testing. #' Defaults to \code{NULL}, no parameters are tested. #' @param priors names list of prior distributions for each -#' predictor. Allows to specify both the null and alternative +#' predictor. It allows users to specify both the null and alternative #' hypothesis prior distributions by assigning a named list #' (with \code{"null"} and \code{"alt"} object) to the predictor -#' predictor. #' @param distributions_weights prior odds for the competing #' distributions #' @param prior_beta_null default prior distribution for the diff --git a/R/plot.R b/R/plot.R index ea5a5b7..2b5d304 100644 --- a/R/plot.R +++ b/R/plot.R @@ -429,11 +429,11 @@ plot_prediction <- function(x, type = "survival", time_range = NULL, new_data = for(i in seq_along(plot_data)){ plot <- plot + ggplot2::geom_polygon( data = data.frame( - x = c(plot_data[[i]][,"time"], rev(plot_data[[i]][,"time"])), - y = c(plot_data[[i]][,"lCI"], rev(plot_data[[i]][,"uCI"]))), - mapping = ggplot2::aes_string( - x = "x", - y = "y"), + x = c(plot_data[[i]][,"time"], rev(plot_data[[i]][,"time"])), + y = c(plot_data[[i]][,"lCI"], rev(plot_data[[i]][,"uCI"]))), + mapping = ggplot2::aes( + x = .data[["x"]], + y = .data[["y"]]), fill = dots[["col.fill"]][i] ) } @@ -444,13 +444,12 @@ plot_prediction <- function(x, type = "survival", time_range = NULL, new_data = x = plot_data[[i]][,"time"], y = plot_data[[i]][,"mean"], level = if(dots[["legend"]]) dots[["legend.text"]][i] else ""), - mapping = ggplot2::aes_string( - x = "x", - y = "y", - size = if(length(dots[["legend.text"]]) > 1) "level", - color = if(length(dots[["legend.text"]]) > 1) "level", - linetype = if(length(dots[["legend.text"]]) > 1) "level", - group = if(length(dots[["legend.text"]]) > 1) "level"), + mapping = ggplot2::aes( + x = .data[["x"]], + y = .data[["y"]], + color = if(length(dots[["legend.text"]]) > 1) .data[["level"]], + linetype = if(length(dots[["legend.text"]]) > 1) .data[["level"]], + group = if(length(dots[["legend.text"]]) > 1) .data[["level"]]), show.legend = dots[["legend"]]) } diff --git a/R/utilities.R b/R/utilities.R index c552149..369ec92 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -50,12 +50,13 @@ RoBSA.get_option <- function(name){ return(eval(RoBSA.private[[name]])) } - +# export the function directly to suppress import warnings +.runjags__findjags <- function() runjags::findjags() # adapted from the runjags package version 2.2.0 RoBSA.private <- new.env() # Use 'expression' for functions to avoid having to evaluate before the package is fully loaded: -assign("JAGS_path", expression(runjags::findjags()), envir = RoBSA.private) +assign("JAGS_path", expression(.runjags__findjags()), envir = RoBSA.private) assign("RoBSA_version", utils::packageVersion("RoBSA"), envir = RoBSA.private) assign("min_jags_major", 4, envir = RoBSA.private) assign("max_jags_major", 4, envir = RoBSA.private) @@ -80,6 +81,7 @@ assign("distributions", .distributions, envir = Ro BayesTools_required <- switch( paste0(RoBSA.version, collapse = "."), "1.0.0" = c("0.2.10", "6.6.6"), + "1.0.1" = c("0.2.10", "6.6.6"), stop("New RoBSA version needs to be defined in '.check_BayesTools' function!") ) diff --git a/R/zzz.R b/R/zzz.R index 8dda0b2..be91304 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -11,7 +11,10 @@ module_location <- NULL warning('The RoBSA module could not be loaded.', call. = FALSE) }else{ - rjags::load.module("RoBSA", path = module_location) + rjags::load.module("RoBSA", path = module_location, quiet = TRUE) + if(!"RoBSA" %in% rjags::list.modules()){ + warning('The RoBSA module could not be loaded.', call. = FALSE) + } } RoBSA.private$module_location <- module_location diff --git a/man/RoBSA.Rd b/man/RoBSA.Rd index 7515ce9..f986405 100644 --- a/man/RoBSA.Rd +++ b/man/RoBSA.Rd @@ -39,10 +39,9 @@ RoBSA( \item{data}{data frame containing the data} \item{priors}{names list of prior distributions for each -predictor. Allows to specify both the null and alternative +predictor. It allows users to specify both the null and alternative hypothesis prior distributions by assigning a named list -(with \code{"null"} and \code{"alt"} object) to the predictor -predictor.} +(with \code{"null"} and \code{"alt"} object) to the predictor} \item{test_predictors}{vector of predictor names to be tested with Bayesian model-averaged testing. diff --git a/man/check_setup.Rd b/man/check_setup.Rd index dec3113..14db5fd 100644 --- a/man/check_setup.Rd +++ b/man/check_setup.Rd @@ -40,10 +40,9 @@ check_setup( \item{data}{data frame containing the data} \item{priors}{names list of prior distributions for each -predictor. Allows to specify both the null and alternative +predictor. It allows users to specify both the null and alternative hypothesis prior distributions by assigning a named list -(with \code{"null"} and \code{"alt"} object) to the predictor -predictor.} +(with \code{"null"} and \code{"alt"} object) to the predictor} \item{test_predictors}{vector of predictor names to be tested with Bayesian model-averaged testing. diff --git a/man/prior_informed.Rd b/man/prior_informed.Rd index 9180f28..53d4da0 100644 --- a/man/prior_informed.Rd +++ b/man/prior_informed.Rd @@ -18,7 +18,7 @@ of meta-analytic effect size estimates based on standardized mean differences social psychology based on prior elicitation with dr. Oosterwijk (Gronau et al. 2017).} } -For medicine, the possible options are based on BartoÅ¡ et al. (2021) +For medicine, the possible options are based on Bartoš et al. (2021) who developed empirical prior distributions for the effect size and heterogeneity parameters of the continuous standardized outcomes based on the Cochrane database of systematic reviews. Use \code{"Cochrane"} for a prior distribution based on the whole database or call diff --git a/man/update.RoBSA.Rd b/man/update.RoBSA.Rd index 567c538..ac3ac5a 100644 --- a/man/update.RoBSA.Rd +++ b/man/update.RoBSA.Rd @@ -42,10 +42,9 @@ if new priors or \code{prior_weights} are not supplied. Defaults to \code{TRUE}. \item{formula}{formula for the survival model} \item{priors}{names list of prior distributions for each -predictor. Allows to specify both the null and alternative +predictor. It allows users to specify both the null and alternative hypothesis prior distributions by assigning a named list -(with \code{"null"} and \code{"alt"} object) to the predictor -predictor.} +(with \code{"null"} and \code{"alt"} object) to the predictor} \item{test_predictors}{vector of predictor names to be tested with Bayesian model-averaged testing. diff --git a/src/Makevars.ucrt b/src/Makevars.ucrt index 9b0401c..76a4362 100644 --- a/src/Makevars.ucrt +++ b/src/Makevars.ucrt @@ -15,7 +15,7 @@ ###################################################################################################### ## Conditionally set the JAGS_ROOT variable (if it is not already set) to a location specified by the CRAN team: -JAGS_ROOT ?= /c/progra~1/JAGS/JAGS-4.3.0 +JAGS_ROOT ?= /c/progra~1/JAGS/JAGS-4.3.1 ## Use the old ABI to match JAGS 4.x compilation on Windows: #PKG_CXXFLAGS = -D_GLIBCXX_USE_CXX11_ABI=0 diff --git a/src/Makevars.win b/src/Makevars.win index 26d1840..efdf148 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -15,7 +15,7 @@ ###################################################################################################### ## Conditionally set the JAGS_ROOT variable (if it is not already set) to a location specified by the CRAN team: -JAGS_ROOT ?= /c/progra~1/JAGS/JAGS-4.3.0 +JAGS_ROOT ?= /c/progra~1/JAGS/JAGS-4.3.1 ## Use the old ABI to match JAGS 4.x compilation on Windows: PKG_CXXFLAGS = -D_GLIBCXX_USE_CXX11_ABI=0 diff --git a/tests/testthat/_snaps/6-plots/ggplot-den-3-1-3.svg b/tests/testthat/_snaps/6-plots/ggplot-den-3-1-3.svg index e8a23f0..2c6cd1b 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-den-3-1-3.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-den-3-1-3.svg @@ -27,7 +27,7 @@ - + diff --git a/tests/testthat/_snaps/6-plots/ggplot-den-6-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-den-6-1-1.svg index f84cc4c..cf59687 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-den-6-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-den-6-1-1.svg @@ -43,12 +43,12 @@ - - - - - - + + + + + + 0.00 @@ -73,17 +73,17 @@ Density - - - + + + - - - + + + - - - + + + x_fac3 = A x_fac3 = B x_fac3 = C diff --git a/tests/testthat/_snaps/6-plots/ggplot-est-3-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-est-3-1-1.svg index 30dbecf..55709e5 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-est-3-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-est-3-1-1.svg @@ -69,18 +69,18 @@ - - - - - - -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + +0 +0.2 +0.4 +0.6 +0.8 +1 diff --git a/tests/testthat/_snaps/6-plots/ggplot-est-3-1-2.svg b/tests/testthat/_snaps/6-plots/ggplot-est-3-1-2.svg index c4f7768..ee26c8c 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-est-3-1-2.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-est-3-1-2.svg @@ -72,18 +72,18 @@ - - - - - - -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + +0 +0.2 +0.4 +0.6 +0.8 +1 diff --git a/tests/testthat/_snaps/6-plots/ggplot-est-5-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-est-5-1-1.svg index e6f3ed2..f551b1a 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-est-5-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-est-5-1-1.svg @@ -71,16 +71,16 @@ - - - - - -0 -0.2 -0.4 -0.6 -0.8 + + + + + +0 +0.2 +0.4 +0.6 +0.8 diff --git a/tests/testthat/_snaps/6-plots/ggplot-est-5-1-2.svg b/tests/testthat/_snaps/6-plots/ggplot-est-5-1-2.svg index 0c6124e..6054072 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-est-5-1-2.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-est-5-1-2.svg @@ -74,16 +74,16 @@ - - - - - -0 -0.2 -0.4 -0.6 -0.8 + + + + + +0 +0.2 +0.4 +0.6 +0.8 diff --git a/tests/testthat/_snaps/6-plots/ggplot-haz-3-1-2.svg b/tests/testthat/_snaps/6-plots/ggplot-haz-3-1-2.svg index 095bf73..d79ebc0 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-haz-3-1-2.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-haz-3-1-2.svg @@ -27,7 +27,7 @@ - + diff --git a/tests/testthat/_snaps/6-plots/ggplot-haz-6-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-haz-6-1-1.svg index cf4836e..b66b08a 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-haz-6-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-haz-6-1-1.svg @@ -43,12 +43,12 @@ - - - - - - + + + + + + 0.00 @@ -73,17 +73,17 @@ Hazard - - - + + + - - - + + + - - - + + + x_fac3 = A x_fac3 = B x_fac3 = C diff --git a/tests/testthat/_snaps/6-plots/ggplot-sur-3-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-sur-3-1-1.svg index 3c2c1fa..edc8b34 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-sur-3-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-sur-3-1-1.svg @@ -27,7 +27,7 @@ - + diff --git a/tests/testthat/_snaps/6-plots/ggplot-sur-6-1-1.svg b/tests/testthat/_snaps/6-plots/ggplot-sur-6-1-1.svg index 24b3540..e214621 100644 --- a/tests/testthat/_snaps/6-plots/ggplot-sur-6-1-1.svg +++ b/tests/testthat/_snaps/6-plots/ggplot-sur-6-1-1.svg @@ -43,12 +43,12 @@ - - - - - - + + + + + + 0.00 @@ -73,17 +73,17 @@ Survival - - - + + + - - - + + + - - - + + + x_fac3 = A x_fac3 = B x_fac3 = C diff --git a/tests/testthat/_snaps/6-plots/plot-models-3-1-1.svg b/tests/testthat/_snaps/6-plots/plot-models-3-1-1.svg index 1859e40..a86ed2f 100644 --- a/tests/testthat/_snaps/6-plots/plot-models-3-1-1.svg +++ b/tests/testthat/_snaps/6-plots/plot-models-3-1-1.svg @@ -90,7 +90,7 @@ - + @@ -105,27 +105,27 @@ Model 3 Model 2 Model 1 -0.00 [0.00, 0.09] -0.06 [-0.08, 0.19] -0.08 [-0.08, 0.23] -0.07 [-0.10, 0.24] -0.06 [-0.08, 0.19] -0.06 [-0.08, 0.19] -0.00 [ 0.00, 0.00] -0.00 [ 0.00, 0.00] -0.00 [ 0.00, 0.00] -0.00 [ 0.00, 0.00] -0.00 [ 0.00, 0.00] -BF = 0.07 [0.10 -> 0.01] -BF = 0.00 [0.10 -> 0.00] -BF = 0.00 [0.10 -> 0.00] -BF = 0.05 [0.10 -> 0.01] -BF = 0.71 [0.10 -> 0.07] -BF = 0.75 [0.10 -> 0.08] -BF = 0.01 [0.10 -> 0.00] -BF = 0.00 [0.10 -> 0.00] -BF = 0.54 [0.10 -> 0.06] -BF = 31.72 [0.10 -> 0.78] +0.00 [0.00, 0.09] +0.06 [-0.08, 0.19] +0.08 [-0.08, 0.23] +0.07 [-0.10, 0.24] +0.06 [-0.08, 0.19] +0.06 [-0.08, 0.19] +0.00 [ 0.00, 0.00] +0.00 [ 0.00, 0.00] +0.00 [ 0.00, 0.00] +0.00 [ 0.00, 0.00] +0.00 [ 0.00, 0.00] +BF = 0.07 [0.10 -> 0.01] +BF = 0.00 [0.10 -> 0.00] +BF = 0.00 [0.10 -> 0.00] +BF = 0.05 [0.10 -> 0.01] +BF = 0.71 [0.10 -> 0.07] +BF = 0.75 [0.10 -> 0.08] +BF = 0.01 [0.10 -> 0.00] +BF = 0.00 [0.10 -> 0.00] +BF = 0.54 [0.10 -> 0.06] +BF = 31.72 [0.10 -> 0.78] diff --git a/tests/testthat/_snaps/6-plots/plot-models-3-1-2.svg b/tests/testthat/_snaps/6-plots/plot-models-3-1-2.svg index 4022408..108ab8e 100644 --- a/tests/testthat/_snaps/6-plots/plot-models-3-1-2.svg +++ b/tests/testthat/_snaps/6-plots/plot-models-3-1-2.svg @@ -75,7 +75,7 @@ - + @@ -85,17 +85,17 @@ Model 8 Model 7 Model 6 -0.06 [-0.08, 0.18] -0.06 [-0.08, 0.19] -0.08 [-0.08, 0.23] -0.07 [-0.10, 0.24] -0.06 [-0.08, 0.19] -0.06 [-0.08, 0.19] -BF = 0.07 [0.10 -> 0.01] -BF = 0.00 [0.10 -> 0.00] -BF = 0.00 [0.10 -> 0.00] -BF = 0.05 [0.10 -> 0.01] -BF = 0.71 [0.10 -> 0.07] +0.06 [-0.08, 0.18] +0.06 [-0.08, 0.19] +0.08 [-0.08, 0.23] +0.07 [-0.10, 0.24] +0.06 [-0.08, 0.19] +0.06 [-0.08, 0.19] +BF = 0.07 [0.10 -> 0.01] +BF = 0.00 [0.10 -> 0.00] +BF = 0.00 [0.10 -> 0.00] +BF = 0.05 [0.10 -> 0.01] +BF = 0.71 [0.10 -> 0.07]