Starting from the A object
A<-c(1,2,3,4)
I want to obtain the following matrix with B and C:
B C
[1,] 1 2
[2,] 1 3
[3,] 1 4
[4,] 2 3
[5,] 2 4
[6,] 3 4
Any idea on how to code this? I was trying to use mutate function in dplyr but I have not managed it.
How to implement this in a dplyr pipe?