Is anyone else having issues with the latest update of xts and/or zoo? Some of my functions that use <b><i>apply.weekly</i></b> or <b><i>apply.daily</i></b> are not working any more. I'm attaching a sample dataset to help you replicate the error. Below is a copy of my RConsole:<div>
<br></div><div><div><b>> str(Data.xts)</b></div><div>An ‘xts’ object from 2010-03-23 04:20:00 to 2011-05-06 15:10:00 containing:</div><div> Data: num [1:17902, 1:2] 1508 1508 1507 1507 1506 ...</div><div> - attr(*, "dimnames")=List of 2</div>
<div> ..$ : NULL</div><div> ..$ : chr [1:2] "Close" "Close.1"</div><div> Indexed by objects of class: [POSIXt,POSIXct] TZ: </div><div> Original class: 'data.frame' </div><div> xts Attributes: </div>
<div>List of 2</div><div> $ tclass : chr [1:2] "POSIXt" "POSIXct"</div><div> $ na.action:Class 'omit' atomic [1:1] 1</div><div> .. ..- attr(*, "index")= num 1.27e+09</div><div><b>> head(Data.xts)</b></div>
<div> Close Close.1</div><div>2010-03-23 04:20:00 1507.750 537.75</div><div>2010-03-23 04:30:00 1507.875 538.50</div><div>2010-03-23 04:40:00 1506.875 538.25</div><div>2010-03-23 04:50:00 1507.000 538.00</div>
<div>2010-03-23 05:00:00 1506.500 538.00</div><div>2010-03-23 05:10:00 1506.500 538.00</div><div><b>> fn_checkApply</b></div><div><i>function(Data=Data_D){</i></div><div><i><br></i></div><div><i> MaxDiff <- max(Data[,1]) - max(Data[,2])</i></div>
<div><i> return(MaxDiff)</i></div><div><i>}</i></div><div><b>> apply.daily(x=Data.xts, FUN=fn_checkApply)</b></div><div><font color="#ff0000"><b>Error in dimnames(x) <- dn : </b></font></div>
<div><font color="#ff0000"><b> length of 'dimnames' [2] not equal to array extent</b></font></div><div><b>> traceback()</b></div><div><b><font color="#ff0000">3: `colnames<-`(`*tmp*`, value = c("Close", "Close.1"))</font></b></div>
<div><b><font color="#ff0000">2: period.apply(x, ep, FUN, ...)</font></b></div><div><b><font color="#ff0000">1: apply.daily(x = Data.xts, FUN = fn_checkApply)</font></b></div>
<div><br></div><div><br></div>Any help would be greatly appreciated. Everything was working fine until I updated the packages on 05/02.<br>-- <br>I'm a great believer in luck, and I find the harder I work the more I have of it. ~Thomas Jefferson<br>
<br>Subhrangshu Nandi<br>Algorithmic Stat-Arb Trader<br>
</div>