title: String translate using dict
body: <p>I want to replace letters in a character vector by other ones, using a dictionary created with <code>dict</code>, as follows</p>
  
  <pre><code>import string
  
  trans1 = str.maketrans("abc","cda")
  trans = dict(zip("abc","cda"))
  out1 = "abcabc".translate(trans1)
  out = "abcabc".translate(trans)
  
  print(out1)
  print(out)
  </code></pre>
  
  <p>The desired output is <code>"cdacda"</code></p>
  
  <p>What I get is</p>
  
  <pre><code>cdacda
  abcabc
  </code></pre>
  
  <p>Now <code>out1</code> is this desired output, but <code>out</code> is not. I can not figure out why this is the case. How can I use the dictionary created via <code>dict</code> in the <code>translate</code> function? So what do I have to change if I want to use <code>translate</code> with <code>trans</code>?</p>