On Wed, Feb 13, 2013 at 7:41 AM, Hadley Wickham <
h.wi...@gmail.com> wrote:
>> "The most unambiguous behaviour is achieved when ‘.fun’ returns a
>> data frame - in that case pieces will be combined with
>> ‘rbind.fill’. If ‘.fun’ returns an atomic vector of fixed length,
>> it will be ‘rbind’ed together and converted to a data frame. Any
>> other values will result in an error."
>>
>> So in my view the better way is
>>
>> ldply(mtcars, function(x) data.frame(mean=mean(x)))
>
> Or ldply(mtcars, "mean"), since there the name of the function is known.