Skip to content
Prev 75962 / 398502 Next

A. Mani : Avoiding loops

On 20 Aug 2005 at 3:26, A. Mani wrote:

            
Hi

I am not sure what exactly you would like to compute, 
**working** example could help. But if you want to do some 
computation for row "i" which depends on row "j", I suppose that 
you can not avoid loops. 

Generally you can use one of aggregate, tapply, by or ave for some 
computation split by factor. See help pages.

tapply(vector or data frame, list(factors), function)

is the standard form.

HTH
Petr
Petr Pikal
petr.pikal at precheza.cz