Update 0-data_prep.R

This commit is contained in:
Kyle Belanger 2023-01-06 15:49:53 -05:00
parent de69edfecc
commit 3abba4a904

View file

@ -101,8 +101,10 @@ ds_cmp <- dplyr$tbl(db, "labevents") %>%
#this keeps failing if run as part of the above query. Moving here to keep going
# keeps only rows that have values for all columns
ds_cmp <- ds_cmp %>% dplyr$filter(dplyr$if_all(.fns = ~!is.na(.))) %>%
dplyr$left_join(patients, by = c("subject_id" = "subject_id"))
ds_cmp <- patients %>%
dplyr$left_join(ds_cmp, by = c("subject_id" = "subject_id")) %>%
dplyr$filter(dplyr$if_all(.fns = ~!is.na(.)))
ds_bmp <- dplyr$tbl(db, "labevents") %>%
@ -116,7 +118,9 @@ ds_bmp <- dplyr$tbl(db, "labevents") %>%
dplyr$filter(!is.na(`50993`) & !is.na(`50995`)) %>%
dplyr$collect()
ds_bmp <- ds_bmp %>% dplyr$filter(dplyr$if_all(.fns = ~!is.na(.)))
ds_bmp <- patients %>%
dplyr$left_join(ds_bmp, by = c("subject_id" = "subject_id")) %>%
dplyr$filter(dplyr$if_all(.fns = ~!is.na(.)))