From 78646f08ebbf4654cdbdaf7b43c6a54c04cc4111 Mon Sep 17 00:00:00 2001 From: Marc Suchard Date: Mon, 30 Oct 2023 11:05:39 -0700 Subject: [PATCH] prepare for new release to fix CRAN errors --- DESCRIPTION | 4 ++-- NEWS.md | 15 +++++++++------ R/DataManagement.R | 4 ++-- R/NewDataConversion.R | 2 +- R/TimeEffects.R | 19 ++++++++++--------- man/appendSqlCyclopsData.Rd | 4 ++-- src/cyclops/Iterators.h | 9 ++++++++- .../drivers/AbstractCrossValidationDriver.cpp | 1 + 8 files changed, 35 insertions(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2ffa7fd5..f0525ba9 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.3.1.99 +Version: 3.3.1.999 Authors@R: c( person("Marc A.", "Suchard", email = "msuchard@ucla.edu", role = c("aut","cre")), person("Martijn J.", "Schuemie", role = "aut"), @@ -30,7 +30,7 @@ Biarch: true URL: https://github.com/ohdsi/cyclops BugReports: https://github.com/ohdsi/cyclops/issues Depends: - R (>= 3.1.0) + R (>= 3.5.0) Imports: rlang, Matrix, diff --git a/NEWS.md b/NEWS.md index 943d8096..0c8f5c71 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,19 +1,22 @@ -develop +Cyclops v3.4.0 ============== Changes: -1. improvements on adaptive likelihood profiling -2. add `auto` option to `cvRepetitions` -3. bumped explicit C++11 requirement up to R v4.1 +1. remove dependence on `BH` +2. improvements on adaptive likelihood profiling +3. add `auto` option to `cvRepetitions` +4. bumped explicit C++11 requirement up to R v4.1 +5. removed deprecated use of `dbplyr:::$.tbl_lazy` + a. breaking change in `dbplyr v2.4.0` Cyclops v3.3.1 ============== Changes: -1. fix uninitialized value in detected in computeAsymptoticPrecisionMatrix(); value was priorType -2. fix memory leak caused by call to ::Rf_error() +1. fix uninitialized value in detected in `computeAsymptoticPrecisionMatrix()`; value was priorType +2. fix memory leak caused by call to `::Rf_error()` 3. fix line-endings on Makevar on windows Cyclops v3.3.0 diff --git a/R/DataManagement.R b/R/DataManagement.R index c5b212e5..d0ca2ca1 100644 --- a/R/DataManagement.R +++ b/R/DataManagement.R @@ -634,8 +634,8 @@ reduce <- function(object, covariates, groupBy, power = 1) { #' \code{appendSqlCyclopsData} appends data to an OHDSI data object. #' #' @details Append data using two tables. The outcomes table is dense and contains ... The covariates table is sparse and contains ... -#' All entries in the outcome table must be sorted in increasing order by {oStratumId, oRowId}. All entries in the covariate table -#' must be sorted in increasing order by {cRowId}. Each cRowId value must match exactly one oRowId value. +#' All entries in the outcome table must be sorted in increasing order by (oStratumId, oRowId). All entries in the covariate table +#' must be sorted in increasing order by (cRowId). Each cRowId value must match exactly one oRowId value. #' #' @param object OHDSI Cyclops data object to append entries #' @param oStratumId Integer vector (optional): non-unique stratum identifier for each row in outcomes table diff --git a/R/NewDataConversion.R b/R/NewDataConversion.R index 67a9424c..0ae9d4ef 100644 --- a/R/NewDataConversion.R +++ b/R/NewDataConversion.R @@ -253,7 +253,7 @@ convertToCyclopsData.tbl_dbi <- function(outcomes, } if (modelType == "pr" | modelType == "cpr") { - if (any(outcomes$time <= 0)) { + if (any(pull(outcomes, .data$time) <= 0)) { stop("time cannot be non-positive", call. = FALSE) } } diff --git a/R/TimeEffects.R b/R/TimeEffects.R index 5ae7aa0e..3bbdb6b5 100644 --- a/R/TimeEffects.R +++ b/R/TimeEffects.R @@ -22,8 +22,8 @@ splitTime <- function(shortOut, cut) { if (!"y" %in% colnames(shortOut)) stop("Must provide observed event status.") if ("rowId" %in% colnames(shortOut)) { shortOut <- shortOut %>% - rename(subjectId = rowId) %>% - arrange(subjectId) + rename(subjectId = .data$rowId) %>% + arrange(.data$subjectId) } else { shortOut <- shortOut %>% mutate(subjectId = row_number()) @@ -36,10 +36,10 @@ splitTime <- function(shortOut, cut) { episode = "stratumId", id = "newSubjectId")) longOut <- longOut %>% - rename(y = event) %>% - mutate(time = tstop - tstart) %>% - select(-c(newSubjectId, tstart, tstop)) %>% - arrange(stratumId, subjectId) + rename(y = .data$event) %>% + mutate(time = .data$tstop - .data$tstart) %>% + select(-c(.data$newSubjectId, .data$tstart, .data$tstop)) %>% + arrange(.data$stratumId, .data$subjectId) # Restore rowIds SubjectIds <- shortOut$subjectId @@ -49,9 +49,10 @@ splitTime <- function(shortOut, cut) { # Reorder columns longOut <- longOut %>% - select(rowId, everything()) %>% - select(subjectId, everything()) %>% - select(stratumId, everything()) + select(.data$stratumId, .data$subjectId, .data$rowId, everything()) + # select(.data$rowId, everything()) %>% + # select(.data$subjectId, everything()) %>% + # select(.data$stratumId, everything()) return(longOut) } diff --git a/man/appendSqlCyclopsData.Rd b/man/appendSqlCyclopsData.Rd index be922eff..6b9547c3 100644 --- a/man/appendSqlCyclopsData.Rd +++ b/man/appendSqlCyclopsData.Rd @@ -37,7 +37,7 @@ appendSqlCyclopsData( } \details{ Append data using two tables. The outcomes table is dense and contains ... The covariates table is sparse and contains ... -All entries in the outcome table must be sorted in increasing order by {oStratumId, oRowId}. All entries in the covariate table -must be sorted in increasing order by {cRowId}. Each cRowId value must match exactly one oRowId value. +All entries in the outcome table must be sorted in increasing order by (oStratumId, oRowId). All entries in the covariate table +must be sorted in increasing order by (cRowId). Each cRowId value must match exactly one oRowId value. } \keyword{internal} diff --git a/src/cyclops/Iterators.h b/src/cyclops/Iterators.h index 46ffb439..de82c796 100644 --- a/src/cyclops/Iterators.h +++ b/src/cyclops/Iterators.h @@ -16,8 +16,15 @@ namespace bsccs { */ template -class IncrementableIterator : public std::iterator { +class IncrementableIterator { public: + + using iterator_category = std::forward_iterator_tag; + using value_type = T; + using difference_type = T; + using pointer = T*; + using reference = T&; + IncrementableIterator(T value) : value(value) { } IncrementableIterator& operator++() { diff --git a/src/cyclops/drivers/AbstractCrossValidationDriver.cpp b/src/cyclops/drivers/AbstractCrossValidationDriver.cpp index f1770ebd..de3246fe 100644 --- a/src/cyclops/drivers/AbstractCrossValidationDriver.cpp +++ b/src/cyclops/drivers/AbstractCrossValidationDriver.cpp @@ -7,6 +7,7 @@ #include #include +#include // #include "boost/iterator/counting_iterator.hpp"