[R] strptime Usage

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Mon Dec 1 07:23:30 CET 2003


Thanks!

On Wed, 26 Nov 2003, Gabor Grothendieck wrote:

> Date: Wed, 26 Nov 2003 00:34:11 -0500 (EST)
> From: Gabor Grothendieck <ggrothendieck at myway.com>
> To: kwan022 at stat.auckland.ac.nz, r-help at stat.math.ethz.ch
> Subject: RE: [R] strptime Usage
> 
> 
> 
> strptime takes a character input and produces a POSIXlt output so
> the format you specify to strptime is the format of the input, 
> not the output:
> 
>    format( strptime("10/22/1986", "%m/%d/%Y"), "%Y-%m" )

It worked perfect.  Just out of interest, if I want to convert (either 
from the original form, i.e. mm/dd/yyyy, or the yyyy-mm form, to quarterly 
format, e.g.:
  1999-1
  1999-2
  1999-3
  1999-4
is it possible to do with strptime?  Or do I have to do something 
creative? ;-D

-- 
Cheers,

Kevin

---------------------------------------------------------------
"Try not.  Do, do!  Or do not.  There is no try"
   Jedi Master Yoda

----
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)




More information about the R-help mailing list