This is one way to implement the idea
the other responses point at:
> myfun <- function(funlist, vec){
+ tmp <- lapply(funlist, function(x)do.call(x, args = list(vec)))
+ names(tmp)[names(tmp) == ""] <-
+ sapply(match.call()[[2]], deparse)[-1][names(tmp) == ""]
+ tmp
+ }
>
>
essage-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Gabor Grothendieck
Sent: Thursday, October 25, 2007 9:12 PM
To: Andrew Smith
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Deparsing part of a list argument
Check out:
http://tolstoy.newcastle.edu.au/R/e2/help/06/10/2242.html
O
Check out:
http://tolstoy.newcastle.edu.au/R/e2/help/06/10/2242.html
On 10/25/07, Andrew Smith <[EMAIL PROTECTED]> wrote:
> Here's a simple example of the type of function I'm trying to write,
> where the first argument is a list of functions:
>
> myfun <- function(funlist, vec){
> tmp <- lap
On 25/10/2007 5:38 PM, Andrew Smith wrote:
> Here's a simple example of the type of function I'm trying to write,
> where the first argument is a list of functions:
>
> myfun <- function(funlist, vec){
> tmp <- lapply(funlist, function(x)do.call(x, args = list(vec)))
> names(tmp) <- name
4 matches
Mail list logo