I am trying to using tapply to calculate several statistics of one variable (Diameter) classified by another variable (Specie).

For mean I write

r <- tapply(X = Diameter, INDEX = list(Specie), FUN = mean)

and it works, but when I try to calculate quantile(.10) -for example- I don't find a right way to do it.

Please, any help will be wellcome.

Thanks a lot.