I have a dataset (nearly 26,000 rows) where I have the first and last names in each column as shown below:
Id Name Firstname1 Firstname2 Firstname3
1 AL BE GAM ZET
2 IO PA TA MA
I want all possible permutations of the first and last names in the result column as follows:
Id Name Firstname1 Firstname2 Firstname3 Result1 Result2... Resultatn
1 AL BE GAM ZET ALBEGAMZET ALBEZETGAM GAMZETBEAL
2 IO PA TA ME IOPATAME IOPAMETA TAMEPAIO
Thanks for your help!
I've tried this but I'm looking for help to generalize
df$result1<-paste(df$Name, df$Firstname1,df$Firstname2,df$Firstname3)
df$result2<-paste(df$Name, df$Firstname1,df$Firstname3,df$Firstname2)