Skip to content
Prev 334687 / 398506 Next

A function which is a sum of other functions...

My first thought was to use Reduce, but I think for this case that is
a bit of overkill.  You can have a vector or list of functions and
just use sapply/lapply on the list of functions then sum the result.
A quick example:
[1] 0.5000000 0.8660254 0.5773503
[1] 1.943376

Just wrap the above in a function with whatever options you want to
use.  If you need the functions to return vectors (of the same length)
then you can still use sapply, but use rowSums, colSums, or apply on
the result instead of sum.
On Thu, Dec 19, 2013 at 12:05 PM, Onur Uncu <onuruncu at gmail.com> wrote: