error in ifelse statement.

merge_data.pdf (87.4 KB)

I want to assign the variable "1" in new column "drug_in_bcx_window" with a difference <=2, For >2 as "0".

#calculatation between last_administration_day and blood_culture_day.

drug <- ifelse(df$last_administration_day >= df$blood_culture_day & df$last_administration_day <= df$blood_culture_day, 1, 0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.