I have two data frames, with two columns each, the first being a Date variable. I would like to convert them to xts objects, indexed by the Date column. <b><span style="text-decoration:underline">I would like to use as.Date and not as.POSIXct as the dateformat.</span></b> The puzzling fact is that it works for the first one but not the other. Here is a screenshot of the error:<div>
<br></div><div><div><b>> str(DF1)</b></div><div>'data.frame': 367 obs. of 2 variables:</div><div> $ Date:Class 'Date' num [1:367] 13515 13516 13517 13518 13521 ...</div><div> $ X : num 28.29 -53.58 58.33 -23.07 9.73 ...</div>
<div><b>> str(DF2)</b></div><div>'data.frame': 322 obs. of 2 variables:</div><div> $ Date:Class 'Date' num [1:322] 14061 14062 14063 14067 14068 ...</div><div> $ X : num 56.9 -16.6 50.1 -17.8 18.6 ...</div>
</div><div><div><b>> DF1.xts <- as.xts(DF1, <a href="http://order.by" target="_blank">order.by</a>=as.Date(DF1$Date))</b></div><div>Warning messages:</div><div>1: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), :</div>
<div> unknown timezone 'merica/Chicago'</div><div>2: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), :</div><div> unknown timezone 'merica/Chicago'</div><div>
3: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), :</div><div> unknown timezone 'merica/Chicago'</div><div>4: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), :</div>
<div> unknown timezone 'merica/Chicago'</div><div>5: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), :</div><div> unknown timezone 'merica/Chicago'</div><div>
<div><b>> DF2.xts <- as.xts(DF2, <a href="http://order.by" target="_blank">order.by</a>=as.Date(DF2$Date))</b></div><div><font color="#FF0000"><b>Error in as.POSIXlt.character(x, tz, ...) : </b></font></div>
<div><font color="#FF0000"><b> character string is not in a standard unambiguous format</b></font></div><div><br></div></div><div>I am using R2.10.0, and the latest version of xts (see below). I would like to understand the cause of this error. I have been experiencing pretty random errors with the latest version of R & xts. I was wondering if anyone else is having similar issues. Thanks a lot.</div>
<div><br></div><div><div><b>> version</b></div><div> _ </div><div>platform i386-pc-mingw32 </div><div>arch i386 </div><div>os mingw32 </div>
<div>system i386, mingw32 </div><div>status </div><div>major 2 </div><div>minor 10.0 </div>
<div>
year 2009 </div><div>month 10 </div><div>day 26 </div><div>svn rev 50208 </div><div>
language R </div>
<div>version.string R version 2.10.0 (2009-10-26)</div><div><b>> packageDescription(pkg='xts')</b></div><div>Package: xts</div><div>Type: Package</div><div>Title: Extensible Time Series</div><div>Version: 0.6-9</div>
<div>Date: 2009-10-14</div><div>Author: Jeffrey A. Ryan, Josh M. Ulrich</div><div>Depends: zoo</div><div>Suggests: timeSeries,timeDate,tseries,its,chron,fts,tis</div><div>LazyLoad: yes</div><div>Maintainer: Jeffrey A. Ryan <<a href="mailto:jeff.a.ryan@gmail.com" target="_blank">jeff.a.ryan@gmail.com</a>></div>
<div>Description: Provide for uniform handling of R's different time-based data</div><div> classes by extending zoo, maximizing native format information</div><div> preservation and allowing for user level customization and</div>
<div> extension, while simplifying cross-class interoperability.</div><div>License: GPL-3</div><div>URL: <a href="http://r-forge.r-project.org/projects/xts/" target="_blank">http://r-forge.r-project.org/projects/xts/</a></div>
<div>
Repository: R-Forge</div><div>Repository/R-Forge/Project: xts</div><div>Repository/R-Forge/Revision: 463</div><div>Date/Publication: 2009-11-06 17:56:20</div><div>Packaged: 2009-11-06 21:12:13 UTC; rforge</div><div>Built: R 2.10.0; i386-pc-mingw32; 2009-11-11 00:09:42 UTC; windows</div>
<div><br></div><div>-- File: C:/PROGRA~1/R/R-210~1.0/library/xts/Meta/package.rds </div><div><br></div></div><div><br></div><div>-- <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>High Frequency Trader<br>Breakwater Trading, LLC<br>Chicago, IL 60606<br>
</div></div>