Skip to content

Commit

Permalink
change use of class() to inherits() for R 4.2 language; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchard committed Jun 30, 2022
1 parent 5e94371 commit 4066f12
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", role = c("aut","cre")),
person("Martijn J.", "Schuemie", role = "aut"),
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
==============
Expand Down
6 changes: 3 additions & 3 deletions R/DataManagement.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
6 changes: 3 additions & 3 deletions R/ModelFit.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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
) {
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit 4066f12

Please sign in to comment.