Skip to content

Quantmod

2 messages · Werner Erselina, Joshua Ulrich

#
getSymbols() returns an xts object (which is a subclass of zoo) by
default.  The dates in xts/zoo objects are stored in an "index"
attribute that is unique to xts/zoo objects, so write.table() doesn't
know to write this attribute to the file.

So you need to:
1) Give write.table() the rownames to use via:
write.table(IBM, file = "ibm-data.txt", row.names=index(IBM))
2) Or (my preference) use write.zoo():
write.zoo(IBM, file = "ibm-data.txt")

HTH,
--
Joshua Ulrich
FOSS Trading: www.fosstrading.com
On Sat, Aug 21, 2010 at 5:58 AM, Werner Erselina <w.erselina at gmail.com> wrote: