Hi,
many thanks for your answer. if i set tz="GMT" it does the job. Great! 
thanks

cheers

Benedikt

Am 16.05.2012 12:20, schrieb jholtman [via R]:
> Is the a daylight saving time problem?  Check your timezone and see 
> when it occurred; these times might not be legal.
>
> Sent from my iPad
>
> On May 16, 2012, at 3:27, Benedikt Gehr <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4630229&i=0>> wrote:
>
> > Hi
> >
> > I have a rather large data frame (>7000 rows with 28 columns) which 
> I want
> > to sort by date. Below I have a example of the data frame. The Date 
> column
> > is called DT, is a factor and looks like this:
> >
> > class(res.merge$DT)
> > [1] "factor"
> > head(res.merge$DT)
> > [1] 17.3.2012 13:54:02 17.3.2012 14:00:07 17.3.2012 14:30:25 17.3.2012
> > 15:01:15
> > [5] 17.3.2012 15:32:14 17.3.2012 16:01:29
> > 2530 Levels: 1.4.2012 00:00:52 1.4.2012 00:30:29 ... 9.5.2012 15:30:50
> >
> > res.merge is the data frame unordered. Now I want to order the data 
> frame
> > with:
> >
> > 
> res.ordered<-res.merge[order(as.POSIXct(as.character(res.merge$DT),format="%d.%m.%Y
> > %H:%M:%S")),]
> >
> > This works in fact, however for some reason there are always two 
> entires
> > that go at the end of the data frame for no obvious reason (see below,
> > 09.05.2012 ist the most recent date). And this is the case for 
> different
> > data.frames. The two entries at the end are always 25.3.2012 
> 02:00:xx and
> > 25.3.2012 02.30.xx.
> >
> > Can anybody tell me what the problem is? Any help is most appreciated.
> >
> > Best Benedikt
> >
> > res.ordered[2545:2549,]
> >                     DT Typ  NOD     Day_s DOW_s   Time_s     Long   
>    Lat
> > 2547  9.5.2012 14:30:56 GPS 1893  9.5.2012    We 14:30:00 7.452218 
> 46.43579
> > 2548  9.5.2012 15:02:09 GPS 1893  9.5.2012    We 15:00:35 7.451983 
> 46.43583
> > 2549  9.5.2012 15:30:50 GPS 1893  9.5.2012    We 15:30:00 7.451973 
> 46.43597
> > 1845 25.3.2012 02:00:18 GPS 1848 25.3.2012    So 02:00:01 7.454266 
> 46.45414
> > 1846 25.3.2012 02:30:16 GPS 1848 25.3.2012    So 02:30:00 7.454413 
> 46.45437
> >     Height TOF Status FO_GPS GPS_N AOT     Day_e DOW_e   Time_e   BV 
> Temp
> > SOG
> > 2547 1182.8   3      A      1   143  55  9.5.2012    We 14:30:56 
> 3735   31
> > 0.09
> > 2548 1182.8   3      A      1   143  94  9.5.2012    We 15:02:09 
> 3637   32
> > 0.02
> > 2549 1176.5   3      A      1   143  50  9.5.2012    We 15:30:50 
> 3730   29
> > 0.17
> > 1845 1295.2   3      A      1   151  17 25.3.2012    So 02:00:18 
> 3715    7
> > 0.18
> > 1846 1287.3   3      A      1   144  16 25.3.2012    So 02:30:16 
> 3720    8
> > 0.14
> >     Heading  SAE  HAE BW_2 BW_3  X..
> > 2547   24.90 3.81 9.47 3666 3625 9.08
> > 2548    7.86 0.51 7.17 3593 3586 9.11
> > 2549  344.72 2.86 4.10 3662 3623 9.12
> > 1845  335.54 3.53 5.63 3618 3618 0.81
> > 1846   75.37 5.44 8.96 3618 3618 0.81
> >
> > --
> > View this message in context: 
> http://r.789695.n4.nabble.com/order-a-data-frame-by-date-with-order-tp4630225.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > [hidden email] </user/SendEmail.jtp?type=node&node=4630229&i=1> 
> mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] </user/SendEmail.jtp?type=node&node=4630229&i=2> 
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://r.789695.n4.nabble.com/order-a-data-frame-by-date-with-order-tp4630225p4630229.html 
>
> To unsubscribe from order a data frame by date with order, click here 
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4630225&code=YmVuZWRpa3QuZ2VockBpZXUudXpoLmNofDQ2MzAyMjV8LTc4NzA5MjQxMQ==>.
> NAML 
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>

-- 
Benedikt Gehr
Ph.D. Student

Institute of Evolutionary Biology and Environmental Studies
University of Zurich
Winterthurerstrasse 190
CH-8057 Zurich

Office 13 J 36b
Phone: +41 (0)44 635 49 72
http://www.ieu.uzh.ch/staff/phd/gehr.html



--
View this message in context: http://r.789695.n4.nabble.com/order-a-data-frame-by-date-with-order-tp4630225p4630237.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]

