Skip to content

Commit

Permalink
updates to R2jags
Browse files Browse the repository at this point in the history
  • Loading branch information
hugaped committed Apr 12, 2024
1 parent 373d78b commit 515e1e6
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .github/workflows/R-CMD-check.yaml
@@ -0,0 +1,80 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
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'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck

- name: Install system dependencies (ubuntu)
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- 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
wjags.exe /S
del wjags.exe
shell: cmd

- name: Install jags (macOS-latest)
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install jags
- uses: r-lib/actions/check-r-package@v1

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
13 changes: 13 additions & 0 deletions .travis.yml
@@ -0,0 +1,13 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: required
cache: packages
before_install:
- sudo add-apt-repository ppa:marutter/rrutter -y
- sudo apt-get update
- sudo apt-get install r-cran-rjags
script:
- |
R CMD build .
travis_wait 30 R CMD check packageName*tar.gz
2 changes: 2 additions & 0 deletions CRAN-RELEASE
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2022-02-23.
Once it is accepted, delete this file and tag the release (commit 7370f2b).
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -48,6 +48,7 @@ Suggests:
ggdist (>= 2.4.0),
zoo (>= 1.8-8),
lspline (>= 1.0-0),
formatR (>= 1.14),
netmeta,
knitr,
rmarkdown
Expand Down
1 change: 1 addition & 0 deletions R/globals.R
Expand Up @@ -9,4 +9,5 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c(".", "studyID", "agent",
"Estimate", "2.5%", "50%", "97.5%", "treatment",
"study", "arm", "mod1.mean", "mod2.mean", "argcheck",
"Comparison", "Evidence", "splinefun", "level",
"class.effect",
"user.str"))
52 changes: 52 additions & 0 deletions appveyor.yml
@@ -0,0 +1,52 @@
# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
init:
ps: |
$ErrorActionPreference = "Stop"
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
Import-Module '..\appveyor-tool.ps1'

install:
ps: Bootstrap

cache:
- C:\RLibrary

environment:
NOT_CRAN: true
# env vars that may need to be set, at least temporarily, from time to time
# see https://github.com/krlmlr/r-appveyor#readme for details
# USE_RTOOLS: true
# R_REMOTES_STANDALONE: true

# Adapt as necessary starting from here

build_script:
- travis-tool.sh install_deps

test_script:
- travis-tool.sh run_tests

on_failure:
- 7z a failure.zip *.Rcheck\*
- appveyor PushArtifact failure.zip

artifacts:
- path: '*.Rcheck\**\*.log'
name: Logs

- path: '*.Rcheck\**\*.out'
name: Logs

- path: '*.Rcheck\**\*.fail'
name: Logs

- path: '*.Rcheck\**\*.Rout'
name: Logs

- path: '\*_*.tar.gz'
name: Bits

- path: '\*_*.zip'
name: Bits
1 change: 1 addition & 0 deletions tests/testthat/test_fullset.R
Expand Up @@ -8,6 +8,7 @@ testthat::context("Testing full set of functions")
# Tests default ranking (including cumrank)
# Tests default prediction
# Occasionally tests get.relative
# Includes tests for meta-regression on SSRI dataset


# Tested datasets must have at least 5 agents - options are HF2PPIT, psoriasis, ssri, osteopain, gout(?)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/nma_in_mbnmadose.Rmd
Expand Up @@ -26,7 +26,7 @@ library(dplyr)

Although `MBNMAdose` is intended to be used for dose-response Model-Based Network Meta-Analysis (MBNMA), it can also be adapted to perform standard Network Meta-Analysis (NMA), and this allows users to take advantage of some of the additional features of `MBNMAdose`, such as modelling class effects, for use in standard NMA. As well as fitting class effect models, `MBNMAdose` also allows for nodes-splitting to check for consistency in these models.

To illustrate how this can be done we will use a dataset of inhaled medications for Chronic Obstructive Pulmonary Disease (COPD) from the `netmeta` package (*REF*):
To illustrate how this can be done we will use a dataset of inhaled medications for Chronic Obstructive Pulmonary Disease (COPD) from the `netmeta` package:

```{r, loaddata}
library(netmeta)
Expand Down

0 comments on commit 515e1e6

Please sign in to comment.