[R-SIG-Finance] Reading xts data from csv

Gabor Grothendieck ggrothendieck at gmail.com
Thu Dec 27 01:19:57 CET 2012


On Wed, Dec 26, 2012 at 6:52 PM, Robert A'gata <rhelpacc at gmail.com> wrote:
> Hi,
>
> My understanding is that there is no read.xts allowing us to read xts
> directly from csv. A detour is to use read.zoo and then call as.xts.
> However, I don't know how to get by the case where my csv has multiple
> instances with the same timestamp. read.zoo will choke and

It does not give an error.  It only gives a warning.

> complain that
> duplicate row names is not allowed. I am wondering if there is anyway to
> circumvent this? Thank you.
>

In fact, it does work:

Lines <- "2000-10-01 1
2000-10-01 1"

library(xts)
z <- read.zoo(text = Lines)
x <- as.xts(z)


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-SIG-Finance mailing list