title: R paste() not working - encountering unexpected symbol?
body: <p>new to R. Trying to build the "in(...)" clause of a SQL query using values in an R vector. Having problems building the final quoted string using the paste() function.</p>
  
  <p>To illustrate:</p>
  
  <pre><code>&gt; mylist &lt;- c("1001", "2002", "3003") #imagine these are values in target table
  &gt; sQuote(mylist)
  [1] "‘1001’" "‘2002’" "‘3003’"
  &gt; toString(sQuote(mylist))
  [1] "‘1001’, ‘2002’, ‘3003’"
  &gt; paste( toString(sQuote(mylist)), sep="" collapse="" )
  Error: unexpected symbol in "paste( toString(sQuote(mylist)), sep="" collapse"
  &gt; 
  </code></pre>
  
  <p>Why is this error occurring? I am trying to build the string <code>"'1001', '2002', '3003'"</code></p>