I´m pretty new on using R and maybe the question is simple.
I have a character vector with possible combinations of Letters. For example:
[1] "YMC" "YCM" "MYC" "CMY" "CYM" "MCY" "MEH" "HEM" "EMH" "MHE" "EHM" "HME"
[13] "CFF" "FCF" "FFC" "AYY" "YFS" "YYA" "SFY" "YSF" "FSY" "SYF" "YAY" "FYS"
[25] "HYP" "HPY" "WNP" "PWN" "PHY" "PNW" "YHP" "PYH" "WPN" "NPW" "YPH" "NWP"
[37] "BHF" "FHB" "BFH" "HBF" "FBH" "HFB" "BQR" "QRB" "BRQ" "RBQ" "QBR" "RQB"
[49] "BRK" "KRB" "RBK" "BKR" "RKB" "KBR" "WDP" "DPW" "DWP" "WPD" "PDW" "PWD"
And I want to know which strings share the same letter (are made from the same letter but in a different combination).
As you can see the first 6 string come all from "C"+ "Y" +"M" and the second 6 from "M" +"E" +"H".
Or "GPWG" "GWGP" "GPGW" "PWGG" "GGPW" "PGWG" come from:"G" + "G" +"W" + "P"
What kind of code in R I can use to answer to this question in an automatised way?
Many thanks for your help