-
-
Save gabrielburcea/7f7982260ea4522564af419d4d3c89d1 to your computer and use it in GitHub Desktop.
Calculate the Length of stay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################ | |
# calculating total time by using difftime - length of stay | |
################################ | |
dt_los <- dt_subset %>% | |
mutate(LOS = as.numeric(difftime(end_datetime, start_datetime, units = c("days")))) %>% # or minutes? | |
select(pat_code, LOS, admission.type, disch.ward.type) %>% | |
na.omit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment