I have a dataset in data.table format that looks like this:
ID time.s time.e 1 1 2 2 1 4 3 2 3 4 2 4
I want to check if value 1 is between time.s and time.e so that the final result looks like
[1] TRUE TRUE FALSE FALSE
How can i do this? I tried to use
a[1 %in% seq(time.s, time.e)]
But all that I get is all TRUE values. Any recommendations?
source share