Skip to content

Commit 61ccea6

Browse files
committed
splitLexisDT: added warning when there are NA values in the splitting time scale; see issue #140
1 parent 1c19943 commit 61ccea6

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: popEpi
22
Title: Functions for Epidemiological Analysis using Population Data
33
Authors@R: c(person("Joonas", "Miettinen", , "[email protected]", c("aut", "cre")), person("Matti", "Rantanen", , "[email protected]", "aut"), person("Karri", "Seppa", , "[email protected]", "ctb") )
4-
Version: 0.4.3.19
5-
Date: 2017-11-08
4+
Version: 0.4.3.20
5+
Date: 2017-11-13
66
Maintainer: Joonas Miettinen <[email protected]>
77
Description: Enables computation of epidemiological statistics where e.g.
88
counts or mortality rates of the reference population are used. Currently

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ popEpi 0.4.4
22
=====
33
* splitLexisDT/splitMulti bug fix: splitting along multiple time scales _sometimes_ produced duplicate transitions (e.g. alive -> dead in the last two rows). see https://github.com/WetRobot/popEpi/issues/138 for details.
44
* splitLexisDT/splitMulti now retain time.since attribute; this attribute plays a role in cutLexis
5+
* known issue: splitLexisDT/splitMulti not guaranteed to work identically to splitLexis from Epi when there are NA values in the time scale one is splitting along.
56

67

78
popEpi 0.4.3

NEWS.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ devtools::load_all()
1919

2020
* splitLexisDT/splitMulti bug fix: splitting along multiple time scales _sometimes_ produced duplicate transitions (e.g. alive -> dead in the last two rows). see https://github.com/WetRobot/popEpi/issues/138 for details.
2121
* splitLexisDT/splitMulti now retain time.since attribute; this attribute plays a role in cutLexis
22+
* known issue: splitLexisDT/splitMulti not guaranteed to work identically to splitLexis from Epi when there are NA values in the time scale one is splitting along.
2223

2324
# Changes in 0.4.3
2425

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ Changes in 0.4.4
22
================
33

44
- splitLexisDT/splitMulti bug fix: splitting along multiple time scales *sometimes* produced duplicate transitions (e.g. alive -&gt; dead in the last two rows). see <https://github.com/WetRobot/popEpi/issues/138> for details.
5+
- splitLexisDT/splitMulti now retain time.since attribute; this attribute plays a role in cutLexis
6+
- known issue: splitLexisDT/splitMulti not guaranteed to work identically to splitLexis from Epi when there are NA values in the time scale one is splitting along.
57

68
Changes in 0.4.3
79
================

R/splitLexisDT.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ splitLexisDT <- function(lex, breaks, timeScale, merge = TRUE, drop = TRUE) {
154154
ts_is_na <- is.na(lex[[timeScale]])
155155
ts_any_na <- any(ts_is_na)
156156
if (ts_any_na) {
157+
warning("NA values in the time scale you are splitting along ('",
158+
timeScale,"'). Results may deviate from that produced by ",
159+
"splitLexis from package Epi. For safety you may want to split ",
160+
"using only the data with no NA values and combine the the split",
161+
" data with the NA-valued data using rbind.")
157162
lex_na <- lex[ts_is_na, ]
158163
lex <- lex[!ts_is_na, ]
159164
}

0 commit comments

Comments
 (0)