Thank you for replying.

But, I think it creates another problem if I remove it in another code of my 
own.
So, I just want to extract Date and convert it as string without removing 
FUN=as.chron.


Does anyone know another solution ? 


SK Park


-----Original Message-----
From: "Gabor Grothendieck"<[email protected]> 
To: "박상규"<[email protected]>; 
Cc: <[email protected]>; 
Sent: 2012-10-16 (화) 02:40:15
Subject: Re: [R] trouble with extracting Date string from my data.

On Mon, Oct 15, 2012 at 12:32 PM, 박상규 <birdfire94>@naver.com> 
wrote:
> 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 ?
>

If you only want the Date part then omit FUN = as.chron since Date
class is the default.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com




        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to