title: paste/concatenate string involving backslash
body: <p>I have a function which accepts the argument <code>bm</code> (which is then passed to <code>format()</code>). At some point in the function, I would like to use the same argument <code>bm</code> and paste it to an element of a vector. As you can see from the minimal example, the strings are not the same. How can I (given the argument <code>bm</code>) use the argument <code>bm</code> and some sort of <code>paste()</code>... to get the same result as <code>format()</code> (namely <code>\\,</code> instead of <code>\\\\,</code>)?</p>
  
  <pre><code>bm &lt;- "\\\\,"
  x &lt;- format(c(1,10000), big.mark=bm, trim=TRUE)
  y &lt;- x
  y[1] &lt;- paste0(bm, x[1])
  y # both components should contain \\,
  </code></pre>