[Xts-commits] r629 - pkg/xtsExtra/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 13 18:31:40 CEST 2012


Author: weylandt
Date: 2012-06-13 18:31:40 +0200 (Wed, 13 Jun 2012)
New Revision: 629

Modified:
   pkg/xtsExtra/R/arima.R
Log:
Fixed coercion in arima residuals

Modified: pkg/xtsExtra/R/arima.R
===================================================================
--- pkg/xtsExtra/R/arima.R	2012-06-13 16:19:53 UTC (rev 628)
+++ pkg/xtsExtra/R/arima.R	2012-06-13 16:31:40 UTC (rev 629)
@@ -9,9 +9,9 @@
 arima.xts <- function(x, ...){
   check.xts.stats(x)
   
-  ans <- arima(x[, 1, drop = FALSE], ...)
+  ans <- arima(coredata(x[, 1, drop = FALSE]), ...)
   
-  ans$residuals <- as.xts(ans$residuals, time(x))
+  ans$residuals <- xts(ans$residuals, time(x))
   
   class(ans) <- c("xtsArima","Arima")
   
@@ -29,9 +29,9 @@
 arima0.xts <- function(x, ...){
   check.xts.stats(x)
   
-  ans <- arima0(x[, 1, drop = FALSE], ...)
+  ans <- arima0(coredata(x[, 1, drop = FALSE]), ...)
   
-  ans$residuals <- as.xts(ans$residuals, time(x))
+  ans$residuals <- xts(ans$residuals, time(x))
   
   class(ans) <- c("xtsarima0","arima0")
   



More information about the Xts-commits mailing list