Skip to content
Prev 2740 / 15274 Next

Don't success to create xts from lines in code

I would read it as a data.frame, since the index has a comma, then
convert to xts.

quotes <- read.csv(textConnection(lines), header=FALSE)
x <- as.xts(quotes[,-(1:2)],
as.POSIXct(paste(quotes[,1],quotes[,2]),format='%Y.%m.%d %H:%M'))
colnames(x) <- c('Open','High','Low','Close','Volume')

--
http://quantemplation.blogspot.com
On Thu, Jul 24, 2008 at 1:59 PM, <pierre8r-list at yahoo.fr> wrote: