Skip to content
Prev 2736 / 15274 Next

Don't success to create xts from lines in code

See ?read.zoo

1) You need to specify the correct delimiter for your file.
2) read.zoo is converting your index to Date (the default), use
POSIXct instead and be sure to specify the correct format of the index
in your file.

quotes <- read.zoo(textConnection(Lines), sep=',',
FUN=as.POSIXct, format='%m/%d/%Y %H:%M:%S')
x <- as.xts(quotes)
colnames(x) <- c('Open','High','Low','Close','Volume')

--
http://quantemplation.blogspot.com
On Thu, Jul 24, 2008 at 11:54 AM, <pierre8r-list at yahoo.fr> wrote: