I found warning difference using fifelse from data.table library:
fifelse
data.table
set.seed(123) df <- data.table(ID = rep(1:10,each = 2),x = sample(c