[R] Extracting part of date variable

2007-02-01 Thread stat stat
Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it possible to do this in R as well? Rgd, - Here’s a

Re: [R] Extracting part of date variable

2007-02-01 Thread Henrique Dallazuanna
format.Date(c, %d) format.Date(c, %m) format.Date(c, %y) format.Date(c, %Y) On 01/02/07, stat stat [EMAIL PROTECTED] wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it

Re: [R] Extracting part of date variable

2007-02-01 Thread Gabor Grothendieck
Read the help desk article in R News 4/1 about dates and note the table at the end of it, in particular. On 2/1/07, stat stat [EMAIL PROTECTED] wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can

Re: [R] Extracting part of date variable

2007-02-01 Thread Peter Dalgaard
stat stat wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it possible to do this in R as well? Rgd, Yes. One way is to use substr(), e.g.:

Re: [R] Extracting part of date variable

2007-02-01 Thread John Kane
Thank you Peter. It was not my question but I was just about to start the morning's work by searching Help and RSiteSearch() for this exact question. --- Peter Dalgaard [EMAIL PROTECTED] wrote: stat stat wrote: Dear all, Suppose I have a date variable: c = 99/05/12