[R] trouble with extracting Date string from my data.
박상규
birdfire94 at naver.com
Mon Oct 15 18:32:30 CEST 2012
Hello,
I have trouble with extracting Date string from my each row data.
The date format I use is as the follows:
----------------------------------------------------------------------------
-----------
Index,Open,High,Low,Close # header
2011-11-01 9:00:00 ,248.50,248.95,248.20,248.70 ...
....
----------------------------------------------------------------------------
-----------
When I read the data with the below code,
data_min1 <- as.xts(read.zoo("E://log.txt", sep=",", FUN=as.chron,
header=TRUE))
the result is as the follows:
> head(data_min1)
Open High Low Close
(11/01/11 09:00:00) 248.50 248.95 248.20 248.70
(11/01/11 09:01:00) 248.70 249.00 248.65 248.85
(11/01/11 09:02:00) 248.90 249.25 248.70 249.15
(11/01/11 09:03:00) 249.20 249.60 249.10 249.60
(11/01/11 09:04:00) 249.55 249.95 249.50 249.60
(11/01/11 09:05:00) 249.60 249.85 249.55 249.75
>
I tried to extract Date object of each row(2011-11-01) and convert is as
string("2011-11-01").
But I couldn't.
Could you help me ?
Thanks in advance.
SK Park
More information about the R-help
mailing list