having pulled vitals into R using SQL queries
now need to create a table with a regular cadence (e.g. ev 6 hours)
for example prob want the following columns
- hospital_visit_id
- datetime stamp (one per 6hour window)
- label (e.g. is it a RR or a HR etc)
- value (the actual number)
You might want to look at and borrow Ed's code which uses tidyverse
See https://github.com/DocEd/wranglEHR/blob/master/R/extract_timevarying.R
Or Steve's version which uses data.table more
https://github.com/inform-health-informatics/emapR/blob/master/R/extract.R