Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jarathomas committed Aug 13, 2021
1 parent 139e7d1 commit 6c1d42a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CrossVA/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: CrossVA
Type: Package
Title: Verbal Autopsy Data Transformation for InSilicoVA and InterVA5 Algorithms
Version: 1.0.0
Version: 1.0.1
Description: Enables transformation of Verbal Autopsy data collected with the WHO 2016 questionnaire (versions 1.4.1 & 1.5.1)
or the WHO 2014 questionnaire for automated coding of Cause of Death using the InSilicoVA (data.type = "WHO2016") and
InterVA5 algorithms. Previous versions of this package supported user-supplied mappings (via the map_records function), but
Expand Down
5 changes: 2 additions & 3 deletions CrossVA/R/odk2openVA_v141.R
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,8 @@ odk2openVA_v141 <- function (odk, id_col = "meta.instanceID") {
nMonths[is.na(odk[ , indexDataM]) & !is.na(odk[ , indexDataD])] <- 0
nDays[is.na(odk[ , indexDataD]) & !is.na(odk[ , indexDataM])] <- 0
naMonthsAndDays <- is.na(odk[ , indexDataM]) & is.na(odk[ , indexDataD])
iv5Out[nMonths + nDays/30.4 <=12 & !naMonthsAndDays, 284] <- "y"
iv5Out[nMonths + nDays/30.4 > 12 & !naMonthsAndDays, 284] <- "n"

iv5Out[!naMonthsAndDays & (nMonths + nDays/30.4) <=12, 284] <- "y"
iv5Out[!naMonthsAndDays & (nMonths + nDays/30.4) > 12, 284] <- "n"

#285) Was the baby born in a health facility or clinic? born fac
indexData <- which(stri_endswith_fixed(odkNames, whoNames[285]))
Expand Down
4 changes: 2 additions & 2 deletions CrossVA/R/odk2openVA_v151.R
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ odk2openVA_v151 <- function (odk, id_col = "meta.instanceID") {
nMonths[is.na(odk[ , indexDataM]) & !is.na(odk[ , indexDataD])] <- 0
nDays[is.na(odk[ , indexDataD]) & !is.na(odk[ , indexDataM])] <- 0
naMonthsAndDays <- is.na(odk[ , indexDataM]) & is.na(odk[ , indexDataD])
iv5Out[nMonths + nDays/30.4 <=12 & !naMonthsAndDays, 284] <- "y"
iv5Out[nMonths + nDays/30.4 > 12 & !naMonthsAndDays, 284] <- "n"
iv5Out[!naMonthsAndDays & (nMonths + nDays/30.4) <=12, 284] <- "y"
iv5Out[!naMonthsAndDays & (nMonths + nDays/30.4) > 12, 284] <- "n"

#285) Was the baby born in a health facility or clinic? born fac
indexData <- which(stri_endswith_fixed(odkNames, whoNames[285]))
Expand Down

0 comments on commit 6c1d42a

Please sign in to comment.