From 4066f12912ccaebb16ca081d36eff77e929e26c1 Mon Sep 17 00:00:00 2001 From: Marc Suchard Date: Thu, 30 Jun 2022 16:21:20 -0700 Subject: [PATCH] change use of class() to inherits() for R 4.2 language; bump version --- DESCRIPTION | 2 +- NEWS.md | 4 +++- R/DataManagement.R | 6 +++--- R/ModelFit.R | 6 +++--- cran-comments.md | 10 ++++++---- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5427b294..f9555bf2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Cyclops Type: Package Title: Cyclic Coordinate Descent for Logistic, Poisson and Survival Analysis -Version: 3.1.2.9999 +Version: 3.2.0 Authors@R: c( person("Marc A.", "Suchard", email = "msuchard@ucla.edu", role = c("aut","cre")), person("Martijn J.", "Schuemie", role = "aut"), diff --git a/NEWS.md b/NEWS.md index f78990b3..ee655c35 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,11 @@ -Cyclops v3.1.3 +Cyclops v3.2.0 Changes: 1. fixed likelihood profiling when non-convex due to numerical instability 2. fixed parsing of 64-bit covariate IDs +3. fix BLR convergence criterion when there are 0 (survival) events +3. add Jeffrey's prior for single regression coefficient Cyclops v3.1.2 ============== diff --git a/R/DataManagement.R b/R/DataManagement.R index 77db9eda..c5b212e5 100644 --- a/R/DataManagement.R +++ b/R/DataManagement.R @@ -280,15 +280,15 @@ createCyclopsData <- function(formula, sparseFormula, indicatorFormula, modelTyp } time <- time[sortOrder] dx <- dx[sortOrder, ] - if (class(dx) == "numeric") { + if (inherits(dx,"numeric")) { dx = as(dx,"dgeMatrix") } sx <- sx[sortOrder, ] - if (class(sx) == "numeric") { + if (inherits(sx, "numeric")) { sx = Matrix(sx, ncol = 1, sparse = TRUE) } ix <- ix[sortOrder, ] - if (class(ix) == "numeric") { + if (inherits(ix, "numeric")) { ix = Matrix(ix, ncol = 1, sparse = TRUE) } } diff --git a/R/ModelFit.R b/R/ModelFit.R index 62d393d2..ae71ec9d 100644 --- a/R/ModelFit.R +++ b/R/ModelFit.R @@ -355,7 +355,7 @@ fitCyclopsModel <- function(cyclopsData, .checkData <- function(x) { # Check conditions - if (missing(x) || is.null(x$cyclopsDataPtr) || class(x$cyclopsDataPtr) != "externalptr") { + if (missing(x) || is.null(x$cyclopsDataPtr) || !inherits(x$cyclopsDataPtr, "externalptr")) { stop("Improperly constructed cyclopsData object") } if (.isRcppPtrNull(x$cyclopsDataPtr)) { @@ -366,7 +366,7 @@ fitCyclopsModel <- function(cyclopsData, .checkInterface <- function(x, computeDevice = "native", forceNewObject = FALSE, testOnly = FALSE) { if (forceNewObject || is.null(x$cyclopsInterfacePtr) - || class(x$cyclopsInterfacePtr) != "externalptr" + || !inherits(x$cyclopsInterfacePtr, "externalptr") || .isRcppPtrNull(x$cyclopsInterfacePtr) || .cyclopsGetComputeDevice(x$cyclopsInterfacePtr) != computeDevice ) { @@ -434,7 +434,7 @@ coef.cyclopsFit <- function(object, rescale = FALSE, ignoreConvergence = FALSE, #' #' @export getHyperParameter <- function(object) { - if (class(object) == "cyclopsFit") { + if (inherits(object, "cyclopsFit")) { object$variance } else { NULL diff --git a/cran-comments.md b/cran-comments.md index 3e4bfe41..953a3c98 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,10 +1,12 @@ -## Initial submission of minor patch update to package +## Initial submission of major patch update to package -* optimized likelihood profiling when objective function is concave; no - changes to package dependencies or package API +* fixed likelihood profiling when objective function is non-concave due + to floating-point truncation +* fixed parsing of 64-bit integer covariate IDs +* added Jeffrey's prior for single regression coefficient ## Test environments -* local OS X install, R 4.0.4 +* local OS X install, R 4.1 * ubuntu 20.04 (via gh-actions: devel and release) * win-builder (devel and release)