Skip to content
Prev 4639 / 15274 Next

Read timeseries from csv file with xts or quantmod

Mark,

The as.xts(data.frame) case doesn't work because your data.frame does
not have rownames.  as.xts() converts the rownames into the xts index.
 If you read in your data with the following command, you can then
convert the object to xts.
V2
1948-01-01 51.7
1948-02-01 50.2
1948-03-01 43.3
1948-04-01 45.4
1948-05-01 49.5
1948-06-01 53.0

I would also note that your data, though in a CSV file, is not in CSV
format.  This may have unforeseen consequences when using commands
written for CSV format files (getSymbols.csv, read.csv, etc.).

HTH,
Josh
--
http://www.fosstrading.com
On Fri, Jul 24, 2009 at 10:07 AM, Mark Breman<breman.mark at gmail.com> wrote: