[R] Adding "sum" to derivatives table

From: Martin C. Martin <martin_at_metahuman.org>
Date: Fri 05 Aug 2005 - 03:37:23 EST


Trying this:

deriv(expression(sum(x)), "x")

Gives the error message:

        Function 'sum' is not in the derivatives table

I'd like to add it, is this difficult? If not, where is the derivatives table?

However, give how basic "sum" is, I suspect it would have been added if it were straightforward. Do functions in the derivatives table need to be vectorized? i.e. given a vector of length n, they need to produce a vector of length n? Or is there some other restriction?


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Aug 05 03:50:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:40 EST