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
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
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
'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
У
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
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
6 matches
Mail list logo