I have a dataframe with two columns(both are dates) and a million rows. I have to compare both the dates and return value in the third column. i.e if date in column A is greater
In base:
base
DF$C <- as.numeric(DF$A > DF$B)
In dplyr:
dplyr
DF %>% mutate(C = as.numeric(A > B))