Skip to content

Commit

Permalink
Merge branch 'release/v0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmphillippo committed Dec 4, 2020
2 parents 3c5cb42 + c3adc38 commit d2ef6e3
Show file tree
Hide file tree
Showing 149 changed files with 9,121 additions and 3,817 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
^vignettes/precompile\.R$
^vignettes/children/*$
^cran-comments\.md$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
102 changes: 102 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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, pull_request]

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: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {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"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
CI: true
CXX_OLEVEL: 2
CXX: g++

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- 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@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Setup makevars
run: |
Sys.chmod("configure", mode = "0777")
dir.create("~/.R/")
if (Sys.info()[["sysname"]] == "Windows") {
mv <- "~/.R/Makevars.win"
} else {
mv <- "~/.R/Makevars"
}
file.create(mv)
CXX <- Sys.getenv("CXX")
cCXX <- system("R CMD config CXX", intern = TRUE)
if (CXX == "clang++") {
cCXX <- gsub(" g++", " clang++ -Qunused-arguments -fcolor-diagnostics", cCXX, fixed = TRUE)
}
cat("CXX =", cCXX, "\n", file = mv, append = TRUE)
cCXXFLAGS <- system("R CMD config CXXFLAGS", intern = TRUE)
cCXXFLAGS <- gsub("O[0-3]", paste0("O", Sys.getenv("CXX_OLEVEL")), cCXXFLAGS)
cat("CXXFLAGS =", cCXXFLAGS, "-pedantic -g0 -flto", "\n", file = mv, append = TRUE)
cat("LDFLAGS += -flto", "\n", file = mv, append = TRUE)
cat(readLines(mv), sep = "\n")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_DONTTEST_EXAMPLES_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-multiarch"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
73 changes: 73 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
on:
push:
branches:
- develop
- master

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CXX_OLEVEL: 2
CXX: g++
steps:
- uses: actions/checkout@v2

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

- 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
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Setup makevars
run: |
Sys.chmod("configure", mode = "0777")
dir.create("~/.R/")
if (Sys.info()[["sysname"]] == "Windows") {
mv <- "~/.R/Makevars.win"
} else {
mv <- "~/.R/Makevars"
}
file.create(mv)
CXX <- Sys.getenv("CXX")
cCXX <- system("R CMD config CXX", intern = TRUE)
if (CXX == "clang++") {
cCXX <- gsub(" g++", " clang++ -Qunused-arguments -fcolor-diagnostics", cCXX, fixed = TRUE)
}
cat("CXX =", cCXX, "\n", file = mv, append = TRUE)
cCXXFLAGS <- system("R CMD config CXXFLAGS", intern = TRUE)
cCXXFLAGS <- gsub("O[0-3]", paste0("O", Sys.getenv("CXX_OLEVEL")), cCXXFLAGS)
cat("CXXFLAGS =", cCXXFLAGS, "-pedantic -g0 -flto", "\n", file = mv, append = TRUE)
cat("LDFLAGS += -flto", "\n", file = mv, append = TRUE)
cat(readLines(mv), sep = "\n")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'options(width = 100, mc.cores = parallel::detectCores(), rmarkdown.html_vignette.check_title = FALSE); pkgdown::deploy_to_branch(new_process = FALSE)'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ vignettes/*_files
inst/*.bib.bak
inst/*.bib.sav
inst/doc
docs
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

19 changes: 11 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: multinma
Title: Bayesian Network Meta-Analysis of Individual and Aggregate Data
Version: 0.1.3
Version: 0.2.0
Authors@R:
person(given = c("David", "M."),
family = "Phillippo",
Expand All @@ -23,18 +23,19 @@ Imports:
stats,
graphics,
Rcpp (>= 0.12.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.19.2),
rstantools (>= 2.0.0),
Rdpack (>= 0.7),
tibble,
dplyr (>= 0.8.1),
tibble (>= 2.1.3),
dplyr (>= 0.8.3),
rlang,
purrr,
forcats,
glue,
randtoolbox,
copula,
tidyr (>= 0.8.3),
tidyr (>= 1.0.0),
stringr,
Matrix,
igraph,
Expand All @@ -47,10 +48,11 @@ LinkingTo:
BH (>= 1.66.0),
Rcpp (>= 0.12.0),
RcppEigen (>= 0.3.3.3.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.18.1),
StanHeaders (>= 2.18.0)
SystemRequirements: GNU make
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE)
Suggests:
testthat (>= 2.1.0),
Expand All @@ -62,10 +64,11 @@ Suggests:
loo (>= 2.0.0),
logitnorm,
crayon,
tidygraph
tidygraph,
pkgdown
RdMacros: Rdpack
URL: http://github.com/dmphillippo/multinma
BugReports: http://github.com/dmphillippo/multinma/issues
URL: https://dmphillippo.github.io/multinma/, https://github.com/dmphillippo/multinma
BugReports: https://github.com/dmphillippo/multinma/issues
VignetteBuilder:
knitr,
R.rsp
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ export(dic)
export(distr)
export(dlogitnorm)
export(exponential)
export(flat)
export(half_cauchy)
export(half_normal)
export(half_student_t)
export(is_network_connected)
export(log_normal)
export(multi)
export(nma)
export(normal)
export(pbern)
Expand Down Expand Up @@ -95,6 +97,7 @@ importFrom(rstan,sampling)
importFrom(stats,as.formula)
importFrom(stats,complete.cases)
importFrom(stats,dbinom)
importFrom(stats,dunif)
importFrom(stats,median)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
Expand Down
26 changes: 25 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
# multinma 0.2.0

* Feature: The `set_*()` functions now accept `dplyr::mutate()` style semantics,
allowing inline variable transformations.
* Feature: Added ordered multinomial models, with helper function `multi()` for
specifying the outcomes. Accompanied by a new data set `hta_psoriasis` and
vignette.
* Feature: Implicit flat priors can now be specified, on any parameter, using
`flat()`.
* Improvement: `as.array.stan_nma()` is now much more efficient, meaning that
many post-estimation functions are also now much more efficient.
* Improvement: `plot.nma_dic()` is now more efficient, particularly with large
numbers of data points.
* Improvement: The layering of points when producing "dev-dev" plots using
`plot.nma_dic()` with multiple data types has been reversed for improved clarity
(now AgD over the top of IPD).
* Improvement: Aggregate-level predictions with `predict()` from ML-NMR / IPD
regression models are now calculated in a much more memory-efficient manner.
* Improvement: Added an overview of examples given in the vignettes.
* Improvement: Network plots with `weight_edges = TRUE` no longer produce
legends with non-integer values for the number of studies.
* Fix: `plot.nma_dic()` no longer gives an error when attempting to specify
`.width` argument when producing "dev-dev" plots.

# multinma 0.1.3

* Format DESCRIPTION to CRAN requirements

# multinma 0.1.2

* Wrapped long-running examples in \donttest{} instead of \dontrun{}
* Wrapped long-running examples in `\donttest{}` instead of `\dontrun{}`

# multinma 0.1.1

Expand Down
2 changes: 1 addition & 1 deletion R/adapt_delta.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' divergent transitions.
#'
#' For more details see the Stan documentation available from
#' https://mc-stan.org/users/documentation/.
#' \url{https://mc-stan.org/users/documentation/}.
#'
#' @name adapt_delta
#'
Expand Down
39 changes: 39 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,42 @@

"bcg_vaccine"

#' HTA Plaque Psoriasis
#'
#' Data frame containing the results of 16 trials comparing 8 treatments for
#' moderate-to-severe plaque psoriasis from an HTA report
#' \insertCite{Woolacott2006}{multinma}, analysed in TSD2
#' \insertCite{TSD2}{multinma}. Outcomes are success/failure to achieve 50%,
#' 75%, or 90% reduction in symptoms on the Psoriasis Area and Severity Index
#' (PASI) scale. Some studies report all three ordered outcomes, others only one
#' or two. The latter are coded as missing values (see details).
#'
#' @format A data frame with 39 rows and 9 variables:
#' \describe{
#' \item{studyn}{numeric study ID}
#' \item{studyc}{study name}
#' \item{year}{year of publication}
#' \item{trtn}{numeric treatment code}
#' \item{trtc}{treatment name}
#' \item{sample_size}{sample size in each arm}
#' \item{PASI50, PASI75, PASI90}{ordered multinomial outcome counts (exclusive, see details)}
#' }
#'
#' @details Outcome counts are "exclusive"; that is, for a study reporting all
#' outcomes, the counts represent the categories 50 < PASI < 75, 75 < PASI <
#' 90, and 90 < PASI < 100, and are named by the lower end of the interval.
#' (As opposed to "inclusive" counts, which would represent the overlapping
#' categories PASI > 50, PASI > 70, and PASI > 90.) The count for the fourth
#' category (the lowest), 0 < PASI < 50, is equal to `sample_size - PASI50 -
#' PASI75 - PASI90`.
#'
#' Missing values are used where studies only report a subset of the outcomes.
#' For a study reporting only two outcomes, say 50 and 75, the counts
#' represent 50 < PASI < 75 and 75 < PASI < 100. For a study reporting only
#' one outcome, say PASI 75, the count represents 75 < PASI < 100.
#'
#' @references
#' \insertAllCited{}
#'

"hta_psoriasis"
Loading

0 comments on commit d2ef6e3

Please sign in to comment.