Skip to content
Prev 6701 / 15274 Next

basic "date" issue

I think you should also set header=TRUE in read.table.

Samuel

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Joshua Ulrich
Sent: 24 September 2010 14:34
To: Pam
Cc: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] basic "date" issue

Faith,

as.xts.data.frame assumes the rownames of the data.frame contain the
dates/times.  So you need to either:

1) Set the rownames before running as.xts:
rownames(Dataset) <- as.Date(Dataset[,1],"%d.%m.%Y")
as.xts(Dataset)

2) or, use the xts constructor:
xts(Dataset[,-1],as.Date(Dataset[,1],"%d.%m.%Y"))

HTH,
--
Joshua Ulrich
FOSS Trading: www.fosstrading.com
On Fri, Sep 24, 2010 at 8:20 AM, Pam <fkiraz11 at yahoo.com> wrote:
_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 5476 (20100924) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5476 (20100924) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com