I have a dataset in a data.table format that looks as such:
data.table
ID time.s time.e 1 1 2 2 1 4 3 2 3
Assuming that the values of ID are unique:
ID
DT[, list(OK = 1 %in% seq(time.s, time.e)), by = ID]
giving;
ID OK 1: 1 TRUE 2: 2 TRUE 3: 3 FALSE 4: 4 FALSE