Re: [R] summing elements in a list of functions

From: James Foadi <>
Date: Fri 20 Oct 2006 - 15:14:55 GMT

Many thanks to those who have answered my question. Could I ask Gabor and Peter the meaning of:

> sum(sapply(ttt,function(f) f(x)))

I gather that a "mysterious" function f(x) is applied to all components of ttt, and sum can act on this modified object. But what is exactly f? And how does the list object change?



Dr James Foadi
Department of Physics
University of York
York YO10 5DD

web page:
Tel: 0044 1904 434622
Mobile: 0044 7740 678548

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Oct 21 05:01:26 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 20 Oct 2006 - 20:30:38 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.