How can I evaluate a column of a data.table with values of the same column, **each value against the value of the next two positions**. The following example ilustrates the problem and desired result.

```
library(data.table)
dt <- data.table(a = c(2, 3, 2, 4))   
result <- data.table(a = c(2, 3, 2, 4), b = c(T, F, NA, NA))

```