title: How to remove quotes in string values in displaying a matrix?
body: <p><strong>Reproducible example:</strong>  </p>
  
  <pre><code>adfcstable &lt;- function(d, max = 5) {
  d &lt;- as.data.frame(d)
  LevelADFtable &lt;- matrix(, nrow = dim(d)[[2]]*3, ncol = 9) #18x9
  FirstDiffADFtable &lt;- matrix(, nrow = dim(d)[[2]]*3, ncol = 8)  #18x8
  Result &lt;- matrix(, nrow = dim(d)[[2]]*3, ncol = 1)   # 18x1
  ADFtable &lt;- cbind(LevelADFtable, FirstDiffADFtable, Result) # 18 x 18
  colnames(ADFtable) &lt;- c("var","type","levelt","Pc","c","Pt","t","prob","omlo","type","1stDifft","Pc","c","Pt","t","prob","omlo","result")
  
  for (i in as.integer(1:dim(d)[[2]])) {
   for (j in as.integer(1:3)) {
     ADFtable[3*(i-1) + j,1] &lt;- colnames(d)[[i]]
     }
  ADFtable[3*i-2,2] &lt;- "dt"
  ADFtable[3*i-2,10] &lt;- "dt"
  ADFtable[3*i-1,2] &lt;- "d"
  ADFtable[3*i-1,10] &lt;- "d"
  ADFtable[3*i,2] &lt;- "-"
  ADFtable[3*i,10] &lt;- "-"
  }
  ADFtable
  }
  
  repexa &lt;- as.data.frame(matrix(c(rnorm(10), rnorm(10), rnorm(10), rnorm(10), rnorm(10), rnorm(10)),ncol=6),stringsAsFactors = FALSE)
  adfcstable(repexa)
  #      var  type levelt Pc c  Pt t  prob omlo type 1stDifft Pc c  Pt t  prob
  # [1,] "V1" "dt" NA     NA NA NA NA NA   NA   "dt" NA       NA NA NA NA NA  
  # [2,] "V1" "d"  NA     NA NA NA NA NA   NA   "d"  NA       NA NA NA NA NA 
  </code></pre>
  
  <p>In var and type columns, there are values within quotation marks. I want the string values in the data frame without quotes.</p>
  
  <p><strong>What I did to solve the question:</strong></p>
  
  <p>I analyzed similar questions in SOF:</p>
  
  <p><a href="https://stackoverflow.com/questions/20763741/assigning-a-string-to-an-object-without-double-quotes">assigning a string to an object without double quotes</a><br>
  <a href="https://stackoverflow.com/questions/5215481/remove-quotes-from-a-character-vector-in-r">Remove quotes from a character vector in R</a><br>
  <a href="https://stackoverflow.com/questions/19750353/r-how-to-remove-quotation-marks-in-a-vector-of-strings-but-maintain-vector-for">R: How to remove quotation marks in a vector of strings, but maintain vector format as to call each individual value?</a>  </p>
  
  <p>But, they did not work in my example: I got the following errors in trying in those tricks:<br>
  <strong>1.</strong>     # In code, I changed to this (but did not work):<br>
       ADFtable[3*i-2,2] &lt;- noquote("dt")</p>
  
  <p><strong>2.</strong>    # In code, I changed to this (but did not work):<br>
      # ADFtable[3*i-2,2] &lt;- c("dt")</p>
  
  <p><strong>3.</strong>    # In code, I changed to this (but gave error):
      # ADFtable[3*i-2,2] &lt;-  paste0("\n", "dt", "\n")
      adfcstable(repexa)
      Error in ADFtable[3 * i - 2, 2] &lt;- cat(c("dt"), "\n") : 
        number of items to replace is not a multiple of replacement length</p>
  
  <pre><code># I analyzed the error:
  cat(paste0("\n", "dt", "\n"))           # dt
  length(cat(paste0("\n", "dt", "\n")))   # 0
  # Find the reason: Assigning a 0-lengthed value to 1-lengthed one.
  </code></pre>
  
  <p><strong>4.</strong> print(adfcstable(repexa), quote=FALSE) worked a little: but it changed "NA" values to "&lt; NA >" values in displaying the data frame.</p>
  
  <p>What I want is (in displaying of the data frame as the returning value of the function):  </p>
  
  <pre><code>adfcstable(repexa)
  #      var  type levelt Pc c  Pt t  prob omlo type 1stDifft Pc c  Pt t  prob
  # [1,] V1 dt NA     NA NA NA NA NA   NA   dt NA       NA NA NA NA NA  
  # [2,] V1 d  NA     NA NA NA NA NA   NA   d  NA       NA NA NA NA NA 
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>