title: R string with nul character
body: <p>It seems pretty clear that R strings can't have nul characters. (ref: <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/Quotes.html" rel="nofollow noreferrer">https://stat.ethz.ch/R-manual/R-devel/library/base/html/Quotes.html</a>). Problem is, I  need to output some nuls to a file. Below is what I wrote when I didn't know I had a problem, and it works file when my mismatched value is any other character.</p>
  
  <p>The purpose of the code is to take a 2d matrix and output a 1d character string where hits are labelled with hex 80 and mismatches are hex 0 (nul). If R doesn't allow strings to contain NUL, what is the "R" way to do this?</p>
  
  <pre><code>mat&lt;-matrix(c(0,0,0, 0,0,0, 1,0,0),nrow=3,ncol=3)
  PrintCellsWhere&lt;-function(mymat=matrix(),value=-1) {
    outputstring&lt;-""
    for(j in 1:ncol(mymat)) {
      for(i in 1:nrow(mymat)) {
        if(mymat[i,j]==value) {
          outputstring&lt;-paste0(outputstring,"\x80")
        } else{
            outputstring&lt;-paste0(outputstring,"\x00")
        }
      }
    }
    return(outputstring)
  }
  PrintCellsWhere(mymat=mat,value=1)
  </code></pre>
  
  <p>Error message reported : Error: nul character not allowed </p>
  
  <p>The end goal is to output to a file this data construct with nuls in it. I thought I was going to use writeLines...</p>
  
  <p>(Added a better code example)</p>