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 rea
'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
У Пят
On Wed, Feb 2, 2011 at 7:59 AM, Karl Ove Hufthammer 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
>
> fun(3.14, mode
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
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
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
c(mode(3.14),
6 matches
Mail list logo