[R] Request

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Mar 29 14:33:27 CET 2003


As far as I can see those are just character strings, and what has psql to 
do with it?  Some more details would have been helpful.

Your strings do not appear to be valid dates: the ISO standard is
1999-09-29 etc.  So the simplest solution is to use a Standard data
format, which will sort the way you want them.  If you cannot do that, try
?strptime and ?as.POSIXct to see how to convert your strings to POSIXct
dates, and if you want, back to a useful format.

Alternatively, you could re-arrange the strings via strsplit.

The bottom line is simple: use a proper format.  That someone with an 
Italian email address is using an American-only format is puzzling.

On Sat, 29 Mar 2003, Ghosh Mini wrote:

> 
> Dear all,
> 
> I am calling a table (data of several years) by psql command (order by
> date)
> 
> aggregate(mydata[, c("nymphs", "adults")],list(date = mydata$date)
> 
> is giving table order by month (of each year) like
> 
> 
> 1 09-29-1999 0.00000000 0.00000000
> 2 09-30-1999 0.16666667 0.00000000
> 3 10-05-2000 0.55555556 0.05555556
> 4 11-04-2000 0.07142857 0.00000000
> 5 11-05-2000 0.55000000 0.05000000
> 6 12-08-1999 0.00000000 0.00000000
> 7 12-09-2000 0.56410256 0.00000000
> 
> I want it arranged by date (increasing order).

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