Re: [R] Applying multiple functions to one object

2011-02-10 Thread Karl Ove Hufthammer
Den wrote: 'Aggregate multiple functions into a single function. Combine multiple functions to a single function returning a named vector of outputs' This is a short description of each() function from plyr package Here is an example from help each(min, max)(1:10) Thanks! I really

Re: [R] Applying multiple functions to one object

2011-02-04 Thread Karl Ove Hufthammer
Eik Vettorazzi wrote: ... and so the following is from scratch, not from memory. fun-function(x,...){ mthd-list(...) lapply(mthd,function(m) do.call(m,list(x))) } fun(3.14, mode, typeof, class) there is no error-catching for non-existing functions, no naming of results and so on, but

Re: [R] Applying multiple functions to one object

2011-02-04 Thread jctoll
On Wed, Feb 2, 2011 at 7:59 AM, Karl Ove Hufthammer k...@huftis.org wrote: Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply’) somewhere. Example: If the function was named ’fun’ the output of  

Re: [R] Applying multiple functions to one object

2011-02-04 Thread Den
'Aggregate multiple functions into a single function. Combine multiple functions to a single function returning a named vector of outputs' This is a short description of each() function from plyr package Here is an example from help each(min, max)(1:10) Hope this helps Regards Denis У

[R] Applying multiple functions to one object

2011-02-02 Thread Karl Ove Hufthammer
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply’) somewhere. Example: If the function was named ’fun’ the output of fun(3.14, mode, typeof, class) would be identical to the output of

Re: [R] Applying multiple functions to one object

2011-02-02 Thread Eik Vettorazzi
Hi Karl, same to me. Much of the times when coding I think, 'damn it, I have seen that before, but where...' ... and so the following is from scratch, not from memory. fun-function(x,...){ mthd-list(...) lapply(mthd,function(m) do.call(m,list(x))) } fun(3.14, mode, typeof, class) there is no