Skip to content

Commit

Permalink
is_na -> is.na (is_na not available in this context)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Sep 9, 2024
1 parent cd5df2c commit d8b0bde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker-resources/plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function(
if (!retrospectiveTest) {
DBI::dbAppendTable(my_pool, SQL('predictions.ml_weekly_predictions'), prediction_result)
}

# return the result so the API returns *something*
prediction_result
}
Expand Down Expand Up @@ -391,7 +391,7 @@ predict_risk <- function(.data, cohort, age_category) {
predicted_risk =
case_when(
percentile >= .9 ~ "High Risk",
percentile >= .8 & (is_na(predicted_risk) | predicted_risk != "High Risk") ~ "Medium Risk",
percentile >= .8 & (is.na(predicted_risk) | predicted_risk != "High Risk") ~ "Medium Risk",
.default = predicted_risk
)
)%>%
Expand All @@ -401,7 +401,7 @@ predict_risk <- function(.data, cohort, age_category) {
predicted_risk_7day =
case_when(
percentile >= .9 ~ "High Risk",
percentile >= .8 & (is_na(predicted_risk_7day) | predicted_risk_7day != "High Risk") ~ "Medium Risk",
percentile >= .8 & (is.na(predicted_risk_7day) | predicted_risk_7day != "High Risk") ~ "Medium Risk",
.default = predicted_risk
)
)%>%
Expand Down

0 comments on commit d8b0bde

Please sign in to comment.