diff --git a/ML/0-data_prep.R b/ML/0-data_prep.R index 7abcef9..faac273 100644 --- a/ML/0-data_prep.R +++ b/ML/0-data_prep.R @@ -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 ----------------------------------------------------------