Skip to content
Prev 178751 / 398506 Next

Help on apply() function

You are indeed missing something. x is _one row_ of z, not the index
specifying that row. So what you want is:
apply(z, 1, function(x)sum(x[1]*1, x[2]*3))

Thanks for including a reproducible example.

Sarah
On Tue, Apr 28, 2009 at 9:02 PM, megh <megh700004 at yahoo.com> wrote: