Skip to content

Commit 1741964

Browse files
committed
#271 surv_cnsr: refine argument check
1 parent f2899b7 commit 1741964

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ggsurvfit
22
Title: Flexible Time-to-Event Figures
3-
Version: 1.2.0.9000
3+
Version: 1.2.0.9001
44
Authors@R: c(
55
person("Daniel D.", "Sjoberg", , "danield.sjoberg@gmail.com", role = c("aut", "cre", "cph"),
66
comment = c(ORCID = "0000-0003-0862-2018")),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ggsurvfit (development version)
22

33
* `Surv_CNSR()` updated to accept values `>= 1` as censoring values (according
4-
to CDISC recommendation). (#271)
4+
to CDISC recommendation). (#271, @bundfussr)
55

66
# ggsurvfit 1.2.0
77

R/Surv_CNSR.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Surv_CNSR <- function(AVAL, CNSR) {
6868
stop("Expecting arguments 'AVAL' and 'CNSR' to be numeric.")
6969
}
7070

71-
if (any(stats::na.omit(CNSR) < 0)) {
72-
stop("Expecting 'CNSR' argument to be non-negative (>=0).")
71+
if (any(!rlang::is_integerish(CNSR)) || any(stats::na.omit(CNSR) < 0)) {
72+
stop("Expecting 'CNSR' argument to be non-negative integer (>=0).")
7373
}
7474

7575
if (any(AVAL < 0)) {

0 commit comments

Comments
 (0)