title: Using XTS at the start of GARCH Models: Error in xtsAttributes(Returns) : object 'Returns' not found
body: <p>I start by importing a dataset from Excel. My code is then as follows (BTC1 is what I have called the dataset when I imported it).</p>
  <pre><code># Convert column `Date` to date
  BTC1$Date &lt;- as.POSIXlt(BTC1$Date,format=&quot;%Y:%M:%D&quot;, origin = &quot;1899-12-30&quot;)
  
  as.xts(BTC1$Date, order.by = BTC1$Date)
  BTC_XTS1a &lt;- xts(BTC1, order.by = as.Date(BTC1$Date, 1:731))
  
  
  BTCRet &lt;- CalculateReturns(BTC_XTS1a, -7)
  </code></pre>
  <p>This is what comes up:</p>
  <blockquote>
  <p>Error in xtsAttributes(Returns) : object 'Returns' not found</p>
  </blockquote>
  <p>Does anybody have any advice on where I am going wrong? I don't understand why 'Returns' are not found (the PerformanceAnalytics package is installed and called).</p>
  <p>Thanks</p>
  <p>Edit: Here is an example of the data:</p>
  <blockquote>
  <p>dput(head(BTC1, 10))<br />
  structure(list(Date = structure(c(17897, 17898, 17899, 17900,
  17901, 17902, 17903, 17904, 17905, 17906), class = &quot;Date&quot;), Price =
  c(3809.4,
  3873.8, 3780.1, 3802.7, 3785.4, 4004.1, 3985.9, 3971, 3978, 3603.7
  ), Open = c(3709.5, 3809.7, 3874.1, 3780.5, 3802.8, 3785.7, 4004.3,
  3985.8, 3971, 3978.9), High = c(3814.3, 3894.8, 3875.8, 3823.9,
  3846.7, 4034.1, 4028, 4070.5, 4014.2, 4007.7), Low = c(3664.4,
  3768.1, 3753, 3720, 3769, 3758.5, 3945.5, 3943.1, 3957.5, 3562.1
  ), Vol = c(469110, 554470, 450320, 488700, 468450, 529890, 500880,
  514080, 473420, 697310), <code>Change.%</code> = c(0.0269, 0.0169, -0.0242,
  0.006, -0.0046, 0.0578, -0.0045, -0.0037, 0.0017, -0.0941), Range =
  c(149.9,
  126.7, 122.8, 103.9, 77.6999999999998, 275.6, 82.5, 127.4,
  56.6999999999998,
  445.6), Number = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), row.names = c(NA,
  10L), class = &quot;data.frame&quot;)</p>
  </blockquote>