Skip to content
Prev 377178 / 398502 Next

[FORGED] Re: Using apply

On 10/31/18 3:47 PM, jim holtman wrote:

            
<SNIP>

It seems to me to be more "natural" (and perhaps more amenable to 
generalisation) to do:

     s2 <- apply(x,2,function(v){sum(v^2)})

But it's probably just a matter of taste.

cheers,

Rolf