diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 236a8acd..aa41f615 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,7 +2,7 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] + workflow_dispatch: name: R-CMD-check @@ -31,7 +31,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -56,7 +56,7 @@ jobs: key: ${{ runner.os }}-jags-4.3.1 restore-keys: | ${{ runner.os }}-jags- - + # Install JAGS on Windows - name: Install JAGS (Windows) if: runner.os == 'Windows' @@ -71,18 +71,14 @@ jobs: echo "JAGS found in cache, skipping installation" ) - - name: Install system dependencies - 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")') - - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rcmdcheck + extra-packages: | + any::survival + any::rcmdcheck + upgrade: 'TRUE' + cache-version: 2 needs: check diff --git a/DESCRIPTION b/DESCRIPTION index badcc98f..de3a3462 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: JointAI -Version: 1.0.6.9000 +Version: 1.1.0 Title: Joint Analysis and Imputation of Incomplete Data Authors@R: c(person("Nicole S.", "Erler", email = "n.s.erler@umcutrecht.nl", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 007197e2..a9508c6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# JointAI (development version) +# JointAI 1.1.0 ## New features * Added functions `crosscorr()`, `crosscorr_plot()`, `autocorr()` and `autocorr_plot()` @@ -20,6 +20,9 @@ * Fix in identifying the number of workers used in parallel computation with the **future** package. * Fix `summary()` printout showing the wrong MCMC settings when using thinning. +* `rd_vcov()`: fixed issue resulting in error when extracting random effects + variance-covariance matrix from fitted model in case of a multivariate mixed + model. -------------------------------------------------------------------------------- diff --git a/R/helpfunctions_checks.R b/R/helpfunctions_checks.R index 490ef822..e58c09f2 100644 --- a/R/helpfunctions_checks.R +++ b/R/helpfunctions_checks.R @@ -150,7 +150,7 @@ resolve_family_obj <- function(family) { return(thefamily) } -#' Check wheather fixed or formula contains a random effects specification +#' Check whether fixed or formula contains a random effects specification #' #' Checks if the objects provided to the `formula` and `fixed` arguments contain #' a random effects specification. This function is used in random effects diff --git a/R/helpfunctions_melt.R b/R/helpfunctions_melt.R index 793f0d95..ac0a9ad9 100644 --- a/R/helpfunctions_melt.R +++ b/R/helpfunctions_melt.R @@ -30,29 +30,38 @@ melt_list <- function(l, varname = "L1", valname = "value") { # Check for elements that cannot be converted to a data.frame or would # result in differing numbers of columns e.g., formulas, arrays, lists, ... - if (any(lvapply(l, function(x) !is.atomic(x) | !is.vector(x)))) { + if (all(lvapply(l, function(x) is.atomic(x) & is.vector(x)))) { + do.call( + rbind, + lapply(seq_along(l), function(k) { + df <- as.data.frame( + list(l[[k]]), + col.names = valname, + stringsAsFactors = FALSE + ) + + df[, varname] <- names(l)[k] + df + }) + ) + } else if (all(lvapply(l, function(x) is.atomic(x) & inherits(x, "matrix")))) { + do.call( + rbind, + lapply(seq_along(l), function(k) { + df <- as.data.frame( + list(l[[k]]), + stringsAsFactors = FALSE + ) + df[, varname] <- names(l)[k] + df + }) + ) + } else { errormsg( - "In melt_list(): Not all elements are atomic vectors (%s).", - paste_and( - names(Filter(function(x) !is.atomic(x) | !is.vector(x), l)), - dQ = TRUE - ) + "In melt_list(): Not all elements are atomic vectors or matrices (%s). + I don't know how to convert this." ) } - - do.call( - rbind, - lapply(seq_along(l), function(k) { - df <- as.data.frame( - list(l[[k]]), - col.names = valname, - stringsAsFactors = FALSE - ) - - df[, varname] <- names(l)[k] - df - }) - ) } diff --git a/cran-comments.md b/cran-comments.md index 134bc749..b327d086 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,32 @@ +# JointAI (version 1.1.0) + +## Round 1 + +### Test environments +* local macOS Darwin 25.2.0, R 4.5.2 +* windows server 2022 x64 (via github actions), R 4.5.2 +* ubuntu 24.04.3 LTS (via github actions), R 4.4.3, R 4.5.2, devel +* macOS Sequoia 15.7.2 (via github actions), R 4.5.2 +* win-builder (oldrelease, devel and release) + + +### R CMD check results +0 errors | 0 warnings | 1-2 NOTES on win-builder + +#### NOTES +* The Maintainer e-mail address has changed from `n.erler@erasmusmc.nl` to + `n.s.erler@umcutrecht.nl`. This is intentional. +* oldrel-only: “Author field differs from that derived from Authors@R” + This NOTE appears only on R-oldrelease, likely due to differences in how older + R formats ORCID information. + + +### Reverse dependencies +One reverse dependency: "remiod"; passed the check. + +--- + + # JointAI (version 1.0.6) ## Round 1 diff --git a/man/Surv.Rd b/man/Surv.Rd index 655ffd45..8f831c84 100644 --- a/man/Surv.Rd +++ b/man/Surv.Rd @@ -5,7 +5,7 @@ \title{Create a Survival Object} \usage{ Surv(time, time2, event, type = c("right", "left", "interval", "counting", - "interval2", "mstate"), origin = 0) + "interval2"), origin = 0) } \arguments{ \item{time}{ @@ -17,17 +17,20 @@ Surv(time, time2, event, type = c("right", "left", "interval", "counting", ending time of the interval for interval censored or counting process data only. Intervals are assumed to be open on the left and closed on the right, \code{(start, end]}. For counting process - data, \code{event} indicates whether an event occurred at the end of - the interval. + data, \code{event} indicates whether a transtion to another state + occurred at the end of the interval. } \item{event}{ The status indicator, normally 0=alive, 1=dead. Other choices are - \code{TRUE}/\code{FALSE} (\code{TRUE} = death) or 1/2 (2=death). For - interval censored data, the status indicator is 0=right censored, + \code{TRUE}/\code{FALSE} (\code{TRUE} = death), 1/2 (2=death), or + a factor variable. + For interval censored data, the status indicator is 0=right censoed, 1=event at \code{time}, 2=left censored, 3=interval censored. - For multiple endpoint data the event variable will be a factor, - whose first level is treated as censoring. + For multiple endpoint data the event variable will always be a factor, + whose first level is treated as censoring, or more formally + "no transtition at this time point". + There is no constraint on the labels of the factor. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event. } @@ -35,7 +38,9 @@ Surv(time, time2, event, type = c("right", "left", "interval", "counting", \item{type}{ character string specifying the type of censoring. Possible values are \code{"right"}, \code{"left"}, \code{"counting"}, - \code{"interval"}, \code{"interval2"} or \code{"mstate"}. + \code{"interval"}, \code{"interval2"}. The default is multi-state + if \code{event} is a factor, counting process if \code{time2} is + present, or right censored, in that order. } \item{origin}{ @@ -43,7 +48,8 @@ Surv(time, time2, event, type = c("right", "left", "interval", "counting", was intended to be used in conjunction with a model containing time dependent strata in order to align the subjects properly when they cross over - from one strata to another, but it has rarely proven useful.} + from one strata to another, but it has rarely proven useful and is + depricated.} } \description{ This function just calls \code{Surv()} from the diff --git a/man/check_fixed_random.Rd b/man/check_fixed_random.Rd index f82054de..a5d3f261 100644 --- a/man/check_fixed_random.Rd +++ b/man/check_fixed_random.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/helpfunctions_checks.R \name{check_fixed_random} \alias{check_fixed_random} -\title{Check wheather fixed or formula contains a random effects specification} +\title{Check whether fixed or formula contains a random effects specification} \usage{ check_fixed_random(arglist) }