Is any similar/analog Oracle TRANSLATE command in R environment? Need to change specific chars to numbers:
ORACLE way: TRANSLATE('XQWERTY','QWXY','1234')
Result: '312ERT4'
What could be similar in R?
Is any similar/analog Oracle TRANSLATE command in R environment? Need to change specific chars to numbers:
ORACLE way: TRANSLATE('XQWERTY','QWXY','1234')
Result: '312ERT4'
What could be similar in R?
There's a standard function chartr
. Notice that the order of arguments is slightly different than in TRANSLATE
.
chartr("QWXY", "1234", "XQWERTY")
result: "312ERT4"