title: How to insert backslash followed by single quote using paste0 in R?
body: <p>I'm trying to separate the elements in a vector with \' and a comma using paste0. For example:</p>
  
  <pre><code>test_vector = c("test1", "test2", "test3") 
  </code></pre>
  
  <p>I would like to use paste0 to generate the following output: </p>
  
  <blockquote>
    <p>\'test1\', \'test2\', \'test3\' </p>
  </blockquote>
  
  <p>because the backslash character is an escape character itself, </p>
  
  <pre><code>paste0(test_vector, collapse = "\', \'")
  </code></pre>
  
  <p>generates the following: </p>
  
  <blockquote>
    <p>"test1', 'test2', 'test3"</p>
  </blockquote>