Skip to content
Prev 302493 / 398503 Next

sapply() and by()

On Aug 6, 2012, at 7:34 AM, Dominic Roye wrote:

            
If you want to group calculations within categories then sapply is not  
the right function to turn to immediately. Use one of 'aggregate',  
'tapply' or 'ave'.
It is telling you that the unnamed third argument was matched to the  
'trim' parameter of the function 'mean'.


Perhaps:

aggregate( LF[,1:4], list(LF[,5]), mean)
Actually what is deprecated is the function `mean.data.frame`.
Minimal example. PLEASE.
Please do note that you offered an object 'LC' but you code referred  
to 'LF'.
snipped 1800+ length vector
>>>>>>>>>
^^^^^^^^