unable to use "ifelse" function.

drug_in_bcx_window <- as.numeric(ifelse(df$antibiotic_administration - df$blood_culture <= 2, 0, 1))

Can someone please point out the mistake.

Should be administeration_ possibly

What error message do you get?