Hi All,
I'm trying to understand the difference between do.call and lapply for
applying a function to a list. Below is one of the variations of
programs (by Marc Schwartz) discussed here recently to select the first
and last n observations per group.
I've looked in several books, the R FAQ and
On 4/9/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
Hi All,
I'm trying to understand the difference between do.call and lapply for
applying a function to a list. Below is one of the variations of
programs (by Marc Schwartz) discussed here recently to select the first
and last n
On Mon, 2007-04-09 at 12:45 -0400, Muenchen, Robert A (Bob) wrote:
Hi All,
I'm trying to understand the difference between do.call and lapply for
applying a function to a list. Below is one of the variations of
programs (by Marc Schwartz) discussed here recently to select the first
and last
Marc,
That makes the difference between do.call and lapply crystal clear. Your
explanation would make a nice FAQ entry.
Thanks!
Bob
=
Bob Muenchen (pronounced Min'-chen), Manager
Statistical Consulting Center
U of TN Office of
Consider this. If L is a list with n components then
- do.call(f, L) calls f once
- lapply(L, f) calls f n times
On 4/9/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
Hi All,
I'm trying to understand the difference between do.call and lapply for
applying a function to a list. Below