Re: [R] Apply a function for each Row

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu 15 Sep 2005 - 04:20:28 EST


> From: Barry Rowlingson
>
> Marc Bernard wrote:
> > Dear All,
> >
> > I wonder how to apply a given function to each row of a
> data frame. I've seen this function before but don't
> remember its name....
>
> You've just said it twice!
>
> 'apply'!

A small catch: Marc wants to apply the function to rows of a data frame, but apply() expects a matrix or array, and will coerce to such if given a data frame, which may (or may not) be problematic...

Andy

> Baz
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Sep 21 01:35:20 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:03:56 EST