[R] simpel POSIXlt question

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jun 5 23:09:25 CEST 2006


On Mon, 5 Jun 2006, Omar Lakkis wrote:

> How can I access, either to get or set, the  "sec", "min", "hour",
> .... fields of a POSIXlt value as in this example?

Just as for any other list:

> t <- as.POSIXlt("2004-11-01")
> t$sec
[1] 0
> t$sec <- 30
> t
[1] "2004-11-01 00:00:30"

and via [["sec"]] if you prefer.

[ ... ]

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list