Skip to content

Commit 0460b07

Browse files
committed
Update PredictionQueries.R
fixing issue if there are NAs in the prediction extraction
1 parent 67c7329 commit 0460b07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/PredictionQueries.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,19 +1076,19 @@ getFullPredictionPerformances <- function(
10761076
# ?TODO remove this and edit table in OhdsiShinyModules instead
10771077
# set valDb, T, O, TAR to '-' if it is the same as the dev
10781078
sameT <- summaryTable$developmentTargetId == summaryTable$validationTargetId
1079-
if(sum(sameT) > 0){
1079+
if(sum(sameT, na.rm = TRUE) > 0){
10801080
summaryTable$validationTargetName[sameT] <- '-'
10811081
}
10821082
sameO <- summaryTable$developmentOutcomeId == summaryTable$validationOutcomeId
1083-
if(sum(sameO) > 0){
1083+
if(sum(sameO, na.rm = TRUE) > 0){
10841084
summaryTable$validationOutcomeName[sameO] <- '-'
10851085
}
10861086
sameDb <- summaryTable$developmentDatabase == summaryTable$validationDatabase
1087-
if(sum(sameDb) > 0){
1087+
if(sum(sameDb, na.rm = TRUE) > 0){
10881088
summaryTable$validationDatabase[sameDb] <- '-'
10891089
}
10901090
sameTar <- summaryTable$developTimeAtRisk == summaryTable$validationTimeAtRisk
1091-
if(sum(sameTar) > 0){
1091+
if(sum(sameTar, na.rm = TRUE) > 0){
10921092
summaryTable$validationTimeAtRisk[sameTar] <- '-'
10931093
}
10941094

0 commit comments

Comments
 (0)