diff --git a/DESCRIPTION b/DESCRIPTION index 4def065..1f7306b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Type: Package Package: comorbidity -Version: 1.0.2 +Version: 1.0.3.9000 Title: Computing Comorbidity Scores Description: Computing comorbidity indices and scores such as the weighted Charlson score (Charlson, 1987 ) and the Elixhauser @@ -52,7 +52,7 @@ Suggests: rmarkdown, testthat Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.0 Encoding: UTF-8 LazyData: true ByteCompile: true diff --git a/Makefile b/Makefile index dd60780..ee6728c 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ pre_submission_test: R -e "devtools::check_win_devel(quiet = TRUE)" R -e "devtools::check_win_release(quiet = TRUE)" R -e "devtools::check_win_oldrelease(quiet = TRUE)" - R -e "rhub::check_for_cran()" + R -e "devtools::check_mac_release(quiet = TRUE)" +# R -e "rhub::check_for_cran()" R -e "rhub::check(platform = 'macos-m1-bigsur-release')" make style diff --git a/NEWS.md b/NEWS.md index cc7801d..81ae328 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,12 @@ +# comorbidity (development version) + +# comorbidity 1.0.3 + +* Fixed a bug that did not allowed ID columns other than numeric (#55, thanks @norihikorihiko for reporting this). + # comorbidity 1.0.2 -* The `copd` comorbidity for the Charlson index has been renamed to `cpd`, and the `ami` comorbidity for the Charlson index has been renamed to `mi` (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name. +* The `copd` and `ami` comorbidities for the Charlson index have been renamed to `cpd` and `mi`, respectively (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name. * New dataset: ICD10-CM, 2022 version, named `icd10cm_2022`. diff --git a/R/comorbidity.R b/R/comorbidity.R index 1e97210..fbf31dd 100644 --- a/R/comorbidity.R +++ b/R/comorbidity.R @@ -112,22 +112,6 @@ #' @export comorbidity <- function(x, id, code, map, assign0, labelled = TRUE, tidy.codes = TRUE) { - # set.seed(1) - # x <- data.frame( - # id = 1, - # code = sample_diag(10), - # stringsAsFactors = FALSE - # ) - # xa <- data.frame(id = 1:2, code = NA_character_) - # xm <- rbind(x, xa) - # - # x = xm - # id = "id" - # code = "code" - # map = "charlson_icd10_quan" - # assign0 = FALSE - # labelled = T - # tidy.codes = T ### Check arguments arg_checks <- checkmate::makeAssertCollection() # x must be a data.frame (or a data.table) diff --git a/R/matchit.R b/R/matchit.R index 20d1e59..a7611e7 100644 --- a/R/matchit.R +++ b/R/matchit.R @@ -28,8 +28,8 @@ if (!is.null(x[["NA"]])) x[, `NA` := NULL] ### Restore IDs - x <- merge(x, backup, by = id, all.y = TRUE, ) - data.table::setnafill(x = x, type = "const", fill = 0L) + x <- merge(x, backup, by = id, all.y = TRUE) + data.table::setnafill(x = x, type = "const", fill = 0L, cols = which(names(x) != id)) ### Add missing columns for (col in names(regex)) { diff --git a/R/zzz.R b/R/zzz.R index 5bacb14..d6101a6 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,8 +1,8 @@ .onAttach <- function(libname, pkgname) { - tick <- stats::rbinom(n = 1, size = 1, prob = 0.4) + tick <- stats::rbinom(n = 1, size = 1, prob = 0.3) if (tick == 1) { - packageStartupMessage("This is {comorbidity} version 1.0.2.") - packageStartupMessage("A lot has changed since the last release on CRAN, please check-out breaking changes here:") + packageStartupMessage("This is {comorbidity} version 1.0.3.") + packageStartupMessage("A lot has changed since the pre-1.0.0 release on CRAN, please check-out breaking changes here:") packageStartupMessage("-> https://ellessenne.github.io/comorbidity/articles/C-changes.html") } } diff --git a/README.md b/README.md index cc0fc33..01ed914 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # The {comorbidity} Package: Computing Comorbidity Scores -Last updated: 2022-04-06 +Last updated: 2022-07-12 diff --git a/cran-comments.md b/cran-comments.md index 9d4070f..4482b4d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,11 +1,10 @@ ## Test environments -* local R installation, R 4.1.2, Intel-based macOS Big Sur 11.6.2 +* local R installation, R 4.2.1, Intel-based macOS Monterey 12.4 * ubuntu-latest (via GitHub Actions, devel, release, oldrel, 3.5, 3.4) * windows-latest (via GitHub Actions, devel, release, oldrel, 3.5, 3.4) * macos-latest (via GitHub Actions, release, oldrel) * windows (via winbuilder, devel, release, oldrel) -* rhub (with rhub::check_for_cran()) * arm64 mac (via macbuilder) * arm64 mac (via rhub::check(platform = 'macos-m1-bigsur-release')) diff --git a/docs/404.html b/docs/404.html index 29c680d..24a72fa 100644 --- a/docs/404.html +++ b/docs/404.html @@ -24,7 +24,7 @@ comorbidity - 1.0.2 + 1.0.3.9000