Dear All,
 
as a follow up to my previous e-mail (I think I am getting closer...):
 
I am trying to apply the trapezoidal functions to a matric column by column. I have the following code:
 
a <-matrix(c(1:100),ncol=10)
b <-matrix(c(2,4,6,8,10,12,14,16,18,20))
 
apply(a,2,function(b,a) sum(diff(b)*(a[-1]+a[-length(a)]))/2)
 
for some reason i get an error message:
Error in FUN(newX[[, i], ...): argument "a" is missing with no default.
 
Any ideas of why that may be happening?
 
thanks,
 
Andras
	[[alternative HTML version deleted]]

