I have a df that looks like this:
code.1 code.2 code.3 code.4
1: 82 93 NA NA
2: 15 85 93 NA
3: 93 89 NA NA
4: 81 NA NA NA
I'd like to generate a new df that entails all possible permutations of the columns, so for example row 5:8 would be the values of "code.2, code.3, code.4, code.1"
, the rows 9:12 the values of "code.3, code.4, code.1, code.2"
, and so on.
I've tried "permutations" from the gtools package but I keep running into "v is either non-atomic or too short"