Skip to content
Prev 277488 / 398506 Next

using tapply() with the quantile function?

1) tapply will work for quantile, but the syntax was a little off: try this

tapply(Cape $ ResponseTime, Cape $ Grid_ID, quantile, c(0.05, 0.95))

The fourth argument is additional parameters passed to the function
FUN which here is quantile. You could also do this
tapply(Cape $ ResponseTime, Cape $ Grid_ID, function(x) quantile(x,
c(0.05, 0.95)))

2) See 1

3) I can do it with the simplify2array() function but I would have
expected the simplify = T argument to tapply() to get the job done.
Let me look into that and get back to you -- I know for sapply()
simplify = T is what calls simplify2array() so I'm pondering.

Thanks for spending so much time on a well-crafted question,

Michael

PS -- An even easier way to send data via plain text is to use dput()
which creates code that can be directly pasted into an R session to
replicate your data. Super helpful for stuff like this


On Tue, Nov 15, 2011 at 2:54 PM, Kulpanowski, David
<DKulpanowski at leegov.com> wrote: