How to shuffle values in a matrix or data frame so that each value only occurs once in each row/column in R?
For example, here is what I have:
A, A, A, A
B, B, B, B
C, C, C, C
D, D, D, D
E, E, E, E
F, F, F, F
G, G, G, G
What I Want:
A, B, C, D
B, C, D, E
C, D, E, F
D, E, F, G
E, F, G, A
F, G, A, B
G, A, B, C
I either need to shift the column up/down and wrap it to maintain my inputs or do it through some sort of shuffle function that shuffles the columns in a way that still ensures the rows do not repeat.