I have a dataframe with any of these values.
from=c(\"A\",\"C\",\"G\",\"T\",\"R\",\"Y\",\"M\",\"K\",\"W\", \"S\",\"N\")
and I want to replace a
Create a map
map = setNames(to, from)
and go from A to B
dd[] = map[dd]
The map serves as a look-up, associating 'from' names with 'to' values. The assignment preserves matrix dimensions and dimnames.