Re: [R] sort time

2007-10-08 Thread Marc Schwartz
On Mon, 2007-10-08 at 07:26 -0700, Samuel Okoye wrote: > Hello, I have got the following problem: > > times <- c("02.07.2007", "03.07.2007","03.09.2007", > "04.07.2007","05.07.2007") > > mode(times) > [1] "numeric" > > tim <- as.character(times) > > mode(tim) > [1] "character" > > sort(times)

Re: [R] sort time

2007-10-08 Thread Ben Bolker
Samuel Okoye wrote: > > Hello, I have got the following problem: > [snip] > > Assuming that these are in month/day/year format (which I conclude from your sorted values): times <- c("02.07.2007", "03.07.2007","03.09.2007", "04.07.2007","05.07.2007") times2 <- as.Date(times,format="%m.%d.%Y

[R] sort time

2007-10-08 Thread Samuel Okoye
Hello, I have got the following problem: > times <- c("02.07.2007", "03.07.2007","03.09.2007", "04.07.2007","05.07.2007") > mode(times) [1] "numeric" > tim <- as.character(times) > mode(tim) [1] "character" > sort(times) [1] "02.07.2007" "03.07.2007" "03.09.2007" "04.07.2007" "05.07.2007" I