Skip to content

Commit

Permalink
Fix bug when all subjects experience event
Browse files Browse the repository at this point in the history
  • Loading branch information
graemeleehickey committed Feb 16, 2022
1 parent 09719cb commit 4883f91
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: joineR
Type: Package
Title: Joint Modelling of Repeated Measurements and Time-to-Event Data
Version: 1.2.6
Version: 1.2.7
Authors@R: c(
person("Pete", "Philipson", email = "[email protected]",
role = "aut",
Expand Down Expand Up @@ -62,4 +62,4 @@ Suggests:
testthat,
covr
VignetteBuilder: knitr
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# joineR 1.2.7

## Bugs

* Fixed bug for case when all subjects experience events.

# joineR 1.2.6

## Bugs
Expand Down
2 changes: 1 addition & 1 deletion R/prepSurvData.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ prepSurvData <- function(surv.formula, data, id, time.long) {
} else if (ctest == 3) {
compRisk <- TRUE
message("Competing risks detected")
} else if (ctest == 2) {
} else if (ctest == 2 | ctest == 1) {
compRisk <- FALSE
}

Expand Down
2 changes: 1 addition & 1 deletion R/summary.jointdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ summary.jointdata <- function(object, ...) {
out[[3]] <- paste0("No survival data available")
} else {
nn <- names(which(lapply(apply(object$survival, 2, unique), length) <= 3))
if (length(unique(object$survival[[nn]])) == 2) {
if (length(unique(object$survival[[nn]])) %in% c(1L, 2L)) {
out[[3]] <- data.frame(c(sum(object$survival[[nn]]),
sum(object$survival[[nn]] == 0)))
row.names(out[[3]]) <- c("Number of subjects that fail:",
Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Test environments

* macOS-Catalina (local R installation), R 4.0.2
* ubuntu-20.04 (via GitHub actions, release + devel), R 4.1.0
* windows-latest (via GitHub actions, release), R 4.1.0
* macOS-Big Sur (local R installation), R 4.1.2
* ubuntu-20.04 (via GitHub actions, release + devel), R 4.1.2
* windows-latest (via GitHub actions, release), R 4.1.2
* macOS-latest (via GitHub actions, release)
* win-builder (release)
* win-builder (devel)
Expand Down

0 comments on commit 4883f91

Please sign in to comment.