I want to identify rows that contains NA, and is between a zero and a one. Consider this data.table:
DT <- data.table(a = c(0, NA, NA, 0, NA, 1, 1, NA, 0, NA, 1, NA, NA, NA, 0, 1, 1, 0, NA, 0))
# DT
# a
# 1: 0
# 2: NA
# 3: NA
# 4: 0
# 5: NA
# 6: 1
# 7: 1
# 8: NA
# 9: 0
# 10: NA
# 11: 1
# 12: NA
# 13: NA
# 14: NA
# 15: 0
# 16: 1
# 17: 1
# 18: 0
# 19: NA
# 20: 0
How to identify row no. 5, 8, 10 and 12:14?