Skip to content

Commit

Permalink
Update preprocess_data.R
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeMZou committed Jan 21, 2025
1 parent ec1f44d commit 82f860e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions analysis/preprocess/preprocess_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ df <- df %>%
mutate(across(all_of(date_cols),
~ floor_date(as.Date(., format="%Y-%m-%d"), unit = "days")),
across(contains('_birth_year'),
~ format(as.Date(., origin = "1970-01-01"), "%Y")))

~ format(as.Date(., origin = "1970-01-01"), "%Y")),
across(all_of(num_cols), ~ as.numeric(.)),
across(all_of(cat_cols), ~ as.factor(.)))

# Overwrite vaccination information for dummy data and vax cohort only ---------

if(Sys.getenv("OPENSAFELY_BACKEND") %in% c("", "expectations") &&
Expand Down

0 comments on commit 82f860e

Please sign in to comment.