create a new column "any_iv_in_bcx_window" and fill it with TRUE, if "route" = IV and "total_variables" = 1 , and other with 0 as FALSE.
A tibble: 6 × 8
...1 patient_id antibiotic_type route last_administration_day blood_culture_day
1 - 1 -ciprofloxacin - IV - 18 - 3
2 - 1 -ciprofloxacin - IV - 18 - 13
3 - 1 -doxycycline -IV - 16 - 3
4 - 1 -doxycycline -PO - 16 - 13
5 - 1 -penicillin -IV - 15 - 3
6 - 1- penicillin -PO - 15 - 13
Drugs_In_BCX_Window total_variables
15 - 1
5 - 0
13 - 0
3 - 0
12 - 1
6 - 1