GOUACHE David <D.GOUACHE <at> arvalisinstitutduvegetal.fr> writes:
> I was wondering if there is a package in which someone would have > created a quantile function that handles vectors of class "Date". Since dates are just decorated numbers, you can convert in both way. Written the long way: dt = rpois(100,100) class(dt)="Date" dt # [1] "1970-03-30" "1970-04-18" "1970-04-08" "1970-04-13" # Dates are generated now dq= quantile(as.integer(dt)) dq # 0% 25% 50% 75% 100% # 77.00 93.00 98.50 106.25 119.00 class(dq)="Date" dq # 0% 25% 50% 75% 100% #"1970-03-19" "1970-04-04" "1970-04-09" "1970-04-17" "1970-04-30" --- Dieter ______________________________________________ R-help@r-project.org 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.