title: In R what are the common cases of this error: "Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character'"
body: <p>I'm fighting with a strange problem in R. I use an old version of Rcpp to integrate R with some C++ (sadly upgrading is not an option!), the Rcpp I use is the old RccpTemplate one. However I doubt the problem is in there.</p>
  
  <p>I have some R code which runs fine most of the time, but on occasion (especially when processing a large amount of data) fails mysteriously with <code>Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character'</code></p>
  
  <p>It always fails in list operations, e.g.:</p>
  
  <pre><code>res[["blabla"]] = r
  </code></pre>
  
  <p>But if I use <code>options(error=recover)</code> and attempt the same after the error, the assignment can be performed with no problems. The C++ only deals with numeric vectors and is actually far away in time an code from the assignments that fail. </p>
  
  <p>So my vague question is: what are the most common causes of such behaviour? Bad memory? Bad objects (perhaps bad <code>RcppResultSet</code>)? I'm having troubles attacking this issue...</p>
  
  <p>For completeness:</p>
  
  <pre><code>platform       i386-pc-solaris2.10
  arch           i386
  os             solaris2.10
  system         i386, solaris2.10
  status
  major          2
  minor          10.1
  year           2009
  month          12
  day            14
  svn rev        50720
  language       R
  </code></pre>