Update 0-data_prep.R

This commit is contained in:
Kyle Belanger 2023-01-05 15:27:20 -05:00
parent 31d54ccbd4
commit e4e76c08ac

View file

@ -9,6 +9,7 @@ box::use(
,RSQLite
,DBI[dbConnect,dbDisconnect]
,here[here]
,dplyr
)
# globals -----------------------------------------------------------------
@ -19,11 +20,30 @@ db <- dbConnect(
)
test_list <- c(
50862 #Albumin
,50863 #Alkaline Phosphatase
,50861 #Alanine Aminotransferase (ALT)
,50878 #Asparate Aminotransferase (AST)
,51006 #Urea Nitrogen
,50893 #Calcium, Total
,50882 #Bicarbonate
,50902 #Chloride
,50912 #Creatinine
,50931 #Glucose
,50971 #Potassium
,50983 #Sodium
,50885 #Bilirubin, Total
,50976 #Protein, Total
,50993 #Thyroid Stimulating Hormone
,50995 #Thyroxine (T4), FreE
)
# load data ---------------------------------------------------------------
ds <- dplyr$tbl(db, "labevents") %>% dplyr$filter(itemid %in% test_list) %>% dplyr$collect()
# close database ----------------------------------------------------------