Re: [R] repeatedly applying function with matrix-rows as argument

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Mon 30 Jun 2003 - 22:20:50 EST


Message-id: <Pine.LNX.4.44.0306301319030.3913-100000@gannet.stats>

apply(mymatrix, 1, function(x) myfun(x[1], x[2], x[3]))

On Mon, 30 Jun 2003, Maarten Speekenbrink wrote:

> Suppose I have a function which takes three arguments. I would like to
> repeatedly apply the function, using a matrix N*3 in which each row
> supplies the three argements for the function. Is this possible? Thank
> you for your help in advance!
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:12:09 EST