[R] use of aggregate

Erik Iverson eriki at ccbr.umn.edu
Thu Jun 10 21:32:30 CEST 2010



Philip wrote:
> Dear list,
> 
> Is it possible to replace the median in the following code so as to calculate 5 and 95% tiles?
> 
> with( raunheim, aggregate(no, by = list(wd,hr), FUN = "median", na.rm=TRUE) )

Please give reproducible examples that we can run by cutting and pasting!

You should just give the function "quantile" to aggregate's FUN 
argument, instead of "median", and then pass on further parameters just 
as na.rm is passed to median.



More information about the R-help mailing list