I have a tibble of combinations of 1,2, and 3:
> tidyr::crossing(X1 = c(1,2,3), X2 = c(1,2,3))
# A tibble: 9 × 2
X1 X2
<dbl> <dbl>
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
6 2 3
7 3 1
8 3 2
9 3 3
And I would like to filter out row 4, 6, 7, and 8 in this example, because the order does not matter. That is to say, (1, 2) is the same as (2, 1).
Is there a way to generate combinations like this, or filter out rows if a dataframe has already been generated?