Re: [R] question about sorting POSIXt vector

2005-02-10 Thread Petr Pikal
Hi Bogdan the behaviour is result of ct and lt POSIX class try str(test) `POSIXlt', format: chr [1:4] 2005-02-08 18:49:15 2005-02-07 18:36:54 2005-02-04 18:37:03 2005-02-06 18:29:04 str(tst) `POSIXct', format: chr [1:4] 2005-02-08 18:49:15 2005-02-07 18:36:54 2005-02-04 18:37:03 2005-02-06

[R] question about sorting POSIXt vector

2005-02-09 Thread bogdan romocea
Dear useRs, How come the first attempt to sort a POSIXt vector fails (Error: non-atomic type in greater), while the second succeeds? (Code inserted below.) The documentation says that POSIXt is used to allow operations such as subtraction, so I'd expect sorting to work. Is this perhaps an OS

Re: [R] question about sorting POSIXt vector

2005-02-09 Thread Gabor Grothendieck
bogdan romocea br44114 at yahoo.com writes: : : Dear useRs, : : How come the first attempt to sort a POSIXt vector fails (Error: : non-atomic type in greater), while the second succeeds? (Code inserted : below.) The documentation says that POSIXt is used to allow operations : such as

Re: [R] question about sorting POSIXt vector

2005-02-09 Thread Prof Brian Ripley
You can order (which is not the same as sort) POSIXct vectors but not POSIXlt ones. class() on your objects (or str(), but that only shows one class) would have been revealing. It is somewhat fortuitous that you can order and sort POSIXct vectors, as you are ordering the underlying numeric