Re: [R] simpel POSIXlt question

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 06 Jun 2006 - 07:09:25 EST

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@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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 06 07:36:03 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 06 Jun 2006 - 08:10:50 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.