[R] Using Aggregate for Date

Belle ping.yi at gmail.com
Tue Feb 8 00:54:55 CET 2011


Hi,

I am trying to find the min of day for each student in each year. 

Here is the dataset:

date	                     studentid         year
1/1/05 6:07 AM	        236	        20082009
3/27/09 9:45 AM	        236	        20082009
4/29/09 8:44 AM	        236	        20082009
3/27/09 11:36 AM        310	        20082009
4/1/09 10:43 AM	        310	        20082009
10/15/09 8:54 AM	310	        20092010
10/22/09 8:54 AM	310	        20092010
10/28/09 8:06 AM	310      	20092010
11/19/09 9:06 AM	310    	20092010
10/24/07 9:22 AM	335    	20072008
12/13/07 9:26 AM	335    	20072008
2/25/09 1:49 PM   	335    	20082009
3/5/09 2:13 PM    	335    	20082009
4/15/09 1:53 PM   	335	       20082009
10/24/07 12:14 PM	126    	20072008
11/7/07 12:21 PM  	126    	20072008
3/19/09 8:45 AM  	177    	20082009
4/2/09 8:54 AM     	177     	20082009
4/16/09 9:57 AM   	177    	20082009

day_min <- aggregate(mydata$date, by=list(mydata$schoolid, mydata$year),
FUN=min) 

However, the result shows the date is in format as: "1193242974" instead of
"mm/dd/yy HH:MM AM". 

Is there anyway that I can show original date in the result?
Thanks


-- 
View this message in context: http://r.789695.n4.nabble.com/Using-Aggregate-for-Date-tp3265417p3265417.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list