[R] need to delete by time, not date

Schatzi adele_thompson at cargill.com
Tue May 10 17:06:22 CEST 2011


I have a matrix where one column has a date and another column has a time. I
need to delete all times before 6am. I had combined the Date and Time column
into DateTime.

Mat1:
Weight     Date  Time            
7.6 04/28/11 09:03 
8.4 04/29/11 03:11 
8.6 04/29/11 05:32 
8.6 04/29/11 09:53 
1.4 05/01/11 19:52 

I tried just picking up the time:

as.POSIXct(Mat1$Time, format = "%H:%M")

but this assigns the time value today's date.

The final matrix should look like:
Weight     Date  Time   
7.6 04/28/11 09:03 
8.6 04/29/11 09:53 
1.4 05/01/11 19:52 


-----
In theory, practice and theory are the same. In practice, they are not - Albert Einstein
--
View this message in context: http://r.789695.n4.nabble.com/need-to-delete-by-time-not-date-tp3512162p3512162.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list