[R] Cut Dates into bins

TJUN KIAT TEO teotjunk at hotmail.com
Fri Jun 3 10:00:35 CEST 2016


I have two set of dates

2000-01-01

01/01/2000

The second one occurs weekly and the first one occurs in daily. I would like to bin the first set of dates into the second set of dates. What is the best way to do it?

I tried  converting both formats into numeric formats

DateBase=sort(as.numeric(as.POSIXlt(unique(Shipment$DateRequire),format="%Y-%m-%D",origin="1900-01-01")))

Compare=as.numeric(as.POSIXlt(SMA$TIME_DATE,format="%d/%m/%y",origin="01/01/1900"))

But the numeric numbers turned out to be very different.

Tjun Kiat


 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list