The subset of sampleSpace
where the difference between max and min in each row is given by:
ss <- apply(sampleSpace, 1, function(x) abs(diff(range(x))) <= 10)
So you can do
sampleSpace[ss,]
to get just the rows meeting that criterion. There are 25,020 remaining rows. The first 30 are:
sampleSpace[ss,]
#> [,1] [,2] [,3]
#> [1,] 1 2 3
#> [2,] 1 2 4
#> [3,] 1 2 5
#> [4,] 1 2 6
#> [5,] 1 2 7
#> [6,] 1 2 8
#> [7,] 1 2 9
#> [8,] 1 2 10
#> [9,] 1 2 11
#> [10,] 1 3 2
#> [11,] 1 3 4
#> [12,] 1 3 5
#> [13,] 1 3 6
#> [14,] 1 3 7
#> [15,] 1 3 8
#> [16,] 1 3 9
#> [17,] 1 3 10
#> [18,] 1 3 11
#> [19,] 1 4 2
#> [20,] 1 4 3
#> [21,] 1 4 5
#> [22,] 1 4 6
#> [23,] 1 4 7
#> [24,] 1 4 8
#> [25,] 1 4 9
#> [26,] 1 4 10
#> [27,] 1 4 11
#> [28,] 1 5 2
#> [29,] 1 5 3
#> [30,] 1 5 4