Вот проблема, которую я пытаюсь решить.
#Original String
#Where ! is a ambiguous character which represent 2:n different characters. Here i assume it stands for either "1" or "2".
I also have multiple ambiguity characters e.g. "?" = "3" or "4".
"A!!C!!D?"
#I want to know all forms a disambiguated string could take.
I.e, in this case .!!.!!.? could produce
4*4*2 = 32 possibilities.
#I want a function to return all possibilities as a vector.
#e.g. desired return
c("A11C11D3", "A11C12D3", "A11C21D3", "A11C22D3",
"A12C11D3", "A12C12D3", "A12C21D3", "A12C22D3",
...
)
Есть ли простая функция, которую мне не хватает, которая делает это, или мне нужно создать ее с нуля с помощью gsub или аналогичный.