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"&lt;ggrothendieck@gmail.com&gt; 
To: "박상규"&lt;birdfire94@naver.com&gt;; 
Cc: &lt;r-help@r-project.org&gt;; 
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, 박상규 &lt;birdfire94&gt;@naver.com&gt; wrote:
&gt; Hello,
&gt;
&gt; I have trouble with extracting Date string from my each row data.
&gt;
&gt; The date format I use is as the follows:
&gt; ----------------------------------------------------------------------------
&gt; -----------
&gt; Index,Open,High,Low,Close # header
&gt; 2011-11-01  9:00:00 ,248.50,248.95,248.20,248.70 ...
&gt; ....
&gt; ----------------------------------------------------------------------------
&gt; -----------
&gt;
&gt; When I read the data with the below code,
&gt;
&gt; data_min1 &lt;- as.xts(read.zoo("E://log.txt", sep=",", FUN=as.chron,
&gt; header=TRUE))
&gt;
&gt; the result is as the follows:
&gt;
&gt;&gt; head(data_min1)
&gt;                       Open   High    Low  Close
&gt; (11/01/11 09:00:00) 248.50 248.95 248.20 248.70
&gt; (11/01/11 09:01:00) 248.70 249.00 248.65 248.85
&gt; (11/01/11 09:02:00) 248.90 249.25 248.70 249.15
&gt; (11/01/11 09:03:00) 249.20 249.60 249.10 249.60
&gt; (11/01/11 09:04:00) 249.55 249.95 249.50 249.60
&gt; (11/01/11 09:05:00) 249.60 249.85 249.55 249.75
&gt;&gt;
&gt;
&gt; I tried to extract Date object of each row(2011-11-01) and convert is as
&gt; string("2011-11-01").
&gt; But I couldn't.
&gt;
&gt; Could you help me ?
&gt;

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

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




	[[alternative HTML version deleted]]

