Consider the following data table.
dat=data.table(expand.grid(x1=0:6,x2=0:6))
categoryvector=6
points = seq(0,categoryvector,by=ceil(((categoryvector - 0)/(5 - 1))))
Which gives:
keepers = expand.grid(x1=points,x2=points)
x1 x2
1 0 0
2 2 0
3 4 0
4 6 0
5 0 2
6 2 2
7 4 2
8 6 2
9 0 4
10 2 4
11 4 4
12 6 4
13 0 6
14 2 6
15 4 6
16 6 6
How do I keep only the subset of rows in dat
which contain a row from keepers?
In the real data frame, dat, there are other columns but I only care to condition on these two.