Re: [R] how to order POSIXt objects ?

2011-02-14 Thread Mike Marchywka
> Date: Mon, 14 Feb 2011 00:55:12 -0800 > From: jon_d_co...@yahoo.co.uk > To: r-help@r-project.org > Subject: [R] how to order POSIXt objects ? > > > I have a problem ordering by descending magnitude a POSIXt object. Can > som

Re: [R] how to order POSIXt objects ?

2011-02-14 Thread Jeff Newmiller
a) POSIXt represents the idea of a datetime. POSIXct is a compact representation (number of seconds since 1970-01-01 00:00:00 GMT) of this idea. POSIXlt is an inefficient but convenient representation (using nine separate components) of this idea. Either POSIXct or POSIXlt may be treated as a P

Re: [R] how to order POSIXt objects ?

2011-02-14 Thread jim holtman
Thanks. I did not even know about that function; will have to use it in the future. That is the good news/bad news about R; so many things to learn about. On Mon, Feb 14, 2011 at 11:58 AM, Prof Brian Ripley wrote: > See the help page for order.  It has a similar example, and the general > solu

Re: [R] how to order POSIXt objects ?

2011-02-14 Thread Prof Brian Ripley
See the help page for order. It has a similar example, and the general solution is to use xtfrm, not unclass. On Mon, 14 Feb 2011, jim holtman wrote: 'unclass' it first(assuming that it is POSIXct) -unclass(mytime) On Mon, Feb 14, 2011 at 3:55 AM, JonC wrote: I have a problem ordering by

Re: [R] how to order POSIXt objects ?

2011-02-14 Thread Hadley Wickham
It's a bit better to use xtfrm. Hadley On Monday, February 14, 2011, jim holtman wrote: > 'unclass' it first(assuming that it is POSIXct) > > -unclass(mytime) > > On Mon, Feb 14, 2011 at 3:55 AM, JonC wrote: >> >> I have a problem ordering by descending magnitude a POSIXt object. Can >> someone

Re: [R] how to order POSIXt objects ?

2011-02-14 Thread jim holtman
'unclass' it first(assuming that it is POSIXct) -unclass(mytime) On Mon, Feb 14, 2011 at 3:55 AM, JonC wrote: > > I have a problem ordering by descending magnitude a POSIXt object. Can > someone help please and let me know how to work around this. My goal is to > be able to order my data by DATE

[R] how to order POSIXt objects ?

2011-02-14 Thread JonC
I have a problem ordering by descending magnitude a POSIXt object. Can someone help please and let me know how to work around this. My goal is to be able to order my data by DATE and then by descending TIME. I have tried to include as much info as possible below. The problem stems from trying to