[R] MASS fitdistr with plyr or data.table?

Justin jtor14 at gmail.com
Wed Apr 27 23:29:21 CEST 2011


> require(MASS)
> out <- with(weib.test.too, tapply(wind_speed, site, function(x) fitdistr(x,
> 'weibull')))
> estimates <- t(sapply(out, "[[", 1))
> SDs <- t(sapply(out, "[[", 2))
> estimates
> SDs
> 
> HTH,
> Jorge

That'll do nicely and is much more elegant than my current method.  I was sure
there would be some fancy one liner from plyr though!

Thanks a bunch,
Justin



More information about the R-help mailing list