Given an ordered vector of strings where each string shows the possible characters in that position, how can I get all possible combinations of strings?
For example, given the vector:
vec <- c("A", "A", "T", "C", "AG", "ACG", "T", "A", "A")
The possible string combinations, given positions 5 can be either "A" or "G", and 6 can be "A", "C", or "G" are:
strings <- c("AATCAATAA"
"AATCACTAA"
"AATCAGTAA"
"AATCGATAA"
"AATCGCTAA"
"AATCGGTAA")