Skip to content

Commit

Permalink
Merge pull request #320 from insightsengineering/cran-release
Browse files Browse the repository at this point in the history
Cran release
  • Loading branch information
gowerc authored Mar 2, 2022
2 parents 641e0e8 + 2c20651 commit 7a4f1da
Show file tree
Hide file tree
Showing 44 changed files with 3,047 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
^docs$
^pkgdown$
^data-raw$
^.DS_Store$

^CRAN-SUBMISSION$
^cran-comments\.md$
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
- cron: '0 4 * * 1'

name: Check Nightly (CRAN)
name: On Nightly (CRAN)

jobs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
- cron: '0 4 * * 1,2,3,4,5'

name: Check Nightly (Main)
name: On Nightly (Main)

jobs:

Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/check_pr.yaml → .github/workflows/on_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore:
- 'misc/**'

name: Check Pull Requests
name: On Pull Request

jobs:

Expand Down Expand Up @@ -36,10 +36,26 @@ jobs:
- name: Build src
uses: ./.github/actions/build-src


- name: Check
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning")
shell: Rscript {0}



vignettes:
strategy:
fail-fast: true
matrix:
config:
- { image: "ghcr.io/${{ github.repository_owner }}/rbmi:r404"}
- { image: "ghcr.io/${{ github.repository_owner }}/rbmi:r410"}
runs-on: ubuntu-latest
container:
image: ${{ matrix.config.image }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: testthat
run: |
Rscript ./vignettes/build.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- cran

name: Check Pull Requests (CRAN)
name: On Pull Request CRAN

jobs:

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ po/*~
src/*

.DS_store
.DS_Store

nul

Expand Down
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Authors@R: c(
person("Marcel", "Wolbers", email = "[email protected]", role = "ctb"),
person("Roche", role = c("cph", "fnd"))
)
Description: Implements reference based multiple imputation allowing for the imputation of longditudinal datasets using pre-defined strategies.
Description: Implements reference based multiple imputation allowing for the imputation of longitudinal datasets using pre-defined strategies.
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Expand All @@ -26,7 +26,8 @@ Suggests:
bookdown,
lubridate,
purrr,
ggplot2
ggplot2,
R.rsp
Biarch: true
Config/testthat/edition: 3
Imports:
Expand All @@ -50,4 +51,4 @@ SystemRequirements: GNU make
Depends:
R (>= 3.4.0)
License: Apache License (>= 2)
VignetteBuilder: knitr
VignetteBuilder: R.rsp
2 changes: 1 addition & 1 deletion R/ancova.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ancova <- function(data, vars, visits = NULL, weights = c("proportional", "equal
#' @param group Character, the name of the group variable in `data`.
#' @param covariates Character vector containing the name of any additional covariates
#' to be included in the model as well as any interaction terms.
#' @param weights Character, specifies wether to use "proportional" or "equal" weighting for each
#' @param weights Character, specifies whether to use "proportional" or "equal" weighting for each
#' categorical covariate combination when calculating the lsmeans.
#'
#' @details
Expand Down
2 changes: 1 addition & 1 deletion R/dataclasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ print.imputation_df <- function(x, ...) {
#' which contains a matrix of [imputation_single()] objects grouped by a single `id`. The matrix
#' is split so that it has D columns (i.e. for non-bmlmi methods this will always be 1)
#'
#' The `id` attribute is deterimined by extracting the `id` attribute from the contributing
#' The `id` attribute is determined by extracting the `id` attribute from the contributing
#' [imputation_single()] objects. An error is throw if multiple `id` are detected
imputation_list_single <- function(imputations, D = 1) {

Expand Down
2 changes: 1 addition & 1 deletion R/delta.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ get_delta_template <- function(imputations) {
}


#' Calculate delta from a lagged Sscale coefficient
#' Calculate delta from a lagged scale coefficient
#'
#' @description
#' Calculates a delta value based upon a baseline delta value and a
Expand Down
4 changes: 2 additions & 2 deletions R/draws.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
#' - `group`: name of the column in `data` which contains the group variable.
#' - `outcome`: name of the column in `data` which contains the outcome variable.
#' - `covariates`: vector of characters which contains the covariates to be included
#' in the model (including interactions which are specified as "covariateName1*covariateName2").
#' in the model (including interactions which are specified as `"covariateName1*covariateName2"``).
#' If no covariates are provided the default model specification of `outcome ~ 1 + visit + group` will be used.
#' Please note that the `group*visit` interaction
#' is **not** included in the model by default.
Expand Down Expand Up @@ -283,7 +283,7 @@ draws.bmlmi <- function(data, data_ice = NULL, vars, method, ncores = 1, quiet =
#'
#' This function takes a `Stack` object which contains multiple lists of patient ids. The function
#' takes this Stack and pulls a set ids and then constructs a dataset just consisting of these
#' patients (i.e. potentially a boostrap or a jackknife sample).
#' patients (i.e. potentially a bootstrap or a jackknife sample).
#'
#' The function then fits a MMRM model to this dataset to create a sample object. The function
#' repeats this process until `n_target_samples` have been reached. If more than `failure_limit`
Expand Down
4 changes: 2 additions & 2 deletions R/impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impute_internal <- function(draws, references = NULL, update_strategy, strategie
#' that are required for that dataset. The total number of ID's must by equal to the
#' total number of rows within all of `imputes$imputations`
#'
#' To accomdate for `method_bmlmi()` the [impute_data_individual()] function returns
#' To accommodate for `method_bmlmi()` the [impute_data_individual()] function returns
#' a list of [imputation_list_single()] objects with 1 object per each subject.
#'
#' [imputation_list_single()] stores the subjects imputations as a matrix where the columns
Expand Down Expand Up @@ -280,7 +280,7 @@ impute_internal <- function(draws, references = NULL, update_strategy, strategie
#' )
#' ```
#'
#' Note that the different repititions (i.e. the value set for D) are grouped together
#' Note that the different repetitions (i.e. the value set for D) are grouped together
#' sequentially.
#'
convert_to_imputation_list_df <- function(imputes, sample_ids) {
Expand Down
2 changes: 1 addition & 1 deletion R/longData.R
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ longDataConstructor <- R6::R6Class(

#' @description
#' Constructor function.
#' @param data longditudinal dataset.
#' @param data longitudinal dataset.
#' @param vars an `ivars` object created by [set_vars()].
initialize = function(data, vars) {
data_raw <- as_dataframe(data)
Expand Down
2 changes: 1 addition & 1 deletion R/lsmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' @param ... Fixes specific variables to specific values i.e.
#' `trt = 1` or `age = 50`. The name of the argument must be the name
#' of the variable within the dataset.
#' @param .weights Character, specifies wether to use "proportional" or "equal" weighting for each
#' @param .weights Character, specifies whether to use "proportional" or "equal" weighting for each
#' categorical covariate combination when calculating the lsmeans.
#'
#' @references \url{https://CRAN.R-project.org/package=emmeans}
Expand Down
4 changes: 2 additions & 2 deletions R/mcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ fit_mcmc <- function(
}

ignorable_warnings <- c(
"Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.\nRunning the chains for more iterations may help. See\nhttp://mc-stan.org/misc/warnings.html#bulk-ess",
"Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.\nRunning the chains for more iterations may help. See\nhttp://mc-stan.org/misc/warnings.html#tail-ess"
"Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.\nRunning the chains for more iterations may help. See\nhttps://mc-stan.org/misc/warnings.html#bulk-ess",
"Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.\nRunning the chains for more iterations may help. See\nhttps://mc-stan.org/misc/warnings.html#tail-ess"
)

# handle warning: display only warnings if
Expand Down
2 changes: 1 addition & 1 deletion R/mmrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extract_params <- function(fit) {
#' @param group a character / factor vector. Indicates which treatment group the patient belongs to.
#' @param cov_struct a character value. Specifies which covariance structure to use. Must be one of
#' `"us"`, `"toep"`, `"cs"` or `"ar1"`
#' @param REML logical. Specifies whether restricted maximium likelihood should be used
#' @param REML logical. Specifies whether restricted maximum likelihood should be used
#' @param same_cov logical. Used to specify if a shared or individual covariance matrix should be used
#' per `group`
#' @param initial_values a list with names `beta` and `theta`. Specifies the initial values to start
Expand Down
2 changes: 1 addition & 1 deletion R/parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' This function spawns a PSOCK cluster and exports all of the
#' rbmi namespace into the the sub processes as well as loading
#' assertthat and glmmTMB
#' `assertthat` and `glmmTMB`
get_cluster <- function(ncores = 1) {
if (ncores == 1) {
return(NULL)
Expand Down
2 changes: 1 addition & 1 deletion R/strategies.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @references
#' Carpenter, James R., James H. Roger, and Michael G. Kenward. "Analysis of longitudinal
#' trials with protocol deviation: a framework for relevant, accessible assumptions, and
#' inference via multiple imputation." Journal of biopharmaceutical statistics 23.6 (2013):
#' inference via multiple imputation." Journal of Biopharmaceutical statistics 23.6 (2013):
#' 1352-1371.
compute_sigma <- function(sigma_group, sigma_ref, index_mar) {

Expand Down
2 changes: 1 addition & 1 deletion R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ is_num_char_fact <- function(x) {
#' @param x a data.frame like object
#'
#' Utility function to convert a "data.frame-like" object to an actual `data.frame`
#' to avoid issues with inconsitencies on methods (such as `[`() and dplyr's grouped dataframes)
#' to avoid issues with inconsistency on methods (such as `[`() and dplyr's grouped dataframes)
as_dataframe <- function(x) {
x2 <- as.data.frame(x)
row.names(x2) <- NULL
Expand Down
22 changes: 12 additions & 10 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
## Test environments

The package was tested in the following environments (in GitHub actions):

- Ubuntu 20.04, R release
- Windows latest, R release
- Mac OS latest, R release
- Ubuntu 20.04, R devel

## R CMD check results

There were no ERRORs or WARNINGs.
Expand All @@ -26,7 +17,18 @@ There were 3 NOTEs:
❯ checking for GNU extensions in Makefiles ... NOTE
GNU make is a SystemRequirements.

Both of the above notes are a consequence of using rstan in the package following the usage steps as described by the stan developers [here](https://cran.r-project.org/web/packages/rstantools/vignettes/minimal-rstan-package.html). Our understanding from the developers is that they are acceptable to ignore.
Both of the above notes are a consequence of using rstan in the package following the usage steps as described by the stan developers [here](https://cran.r-project.org/web/packages/rstantools/vignettes/minimal-rstan-package.html). Our understanding from the [developers](https://discourse.mc-stan.org/t/using-rstan-in-an-r-package-generates-r-cmd-check-notes/26628) is that they are acceptable to ignore.


## Test environments

The package was tested in the following environments (in GitHub actions):

- Ubuntu 20.04, R release
- Windows latest, R release
- Mac OS latest, R release
- Ubuntu 20.04, R devel


## Downstream dependencies

Expand Down
2 changes: 1 addition & 1 deletion man/ancova_single.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/as_dataframe.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/compute_sigma.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/convert_to_imputation_list_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/d_lagscale.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/draws.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fit_mmrm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_cluster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_draws_mle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/imputation_list_single.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/longDataConstructor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/lsmeans.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion misc/docker/install_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ pkgs <- c(
"roxygen2",
"tinytex",
"bookdown",
"RhpcBLASctl"
"RhpcBLASctl",
"R.rsp"
)

options(warn = 2)
Expand Down
Loading

0 comments on commit 7a4f1da

Please sign in to comment.