title: Renaming header for column in R
body: <p>I have imported a data set from R using the quantmod function and one of the columns does not have a header. I tried giving it a header name because I am trying to run a regression over time.</p>
  
  <p>I got the error below: </p>
  
  <blockquote>
    <p><code>Error in dimnames(x) &lt;- dn :length of 'dimnames' [2] not equal to array extent</code></p>
  </blockquote>
  
  <p>This is the full code I ran:</p>
  
  <pre><code># To load data from FRED 
  
  library(quantmod)
  getSymbols('DAUTONSA',src='FRED')`
  
  ## Subset data as you wish: remove observations after February 2019
  
  date.start &lt;- "1967-01-01"
  date.end &lt;- "2019-02-01"
  AUTOdata &lt;-DAUTONSA[paste(date.start,date.end,sep="/")]
  View(AUTOdata)
  
  summary(AUTOdata)
  plot(AUTOdata)
  
  # Changing names of data
  data.frame(AUTOdata)
  names(AUTOdata) &lt;- c("time", "sales")
  </code></pre>
  
  <p>This is when I got the error function</p>
  
  <p>Any help would be appreciated thanks.</p>