[R] Adding "sum" to derivatives table

Martin C. Martin martin at metahuman.org
Thu Aug 4 19:37:23 CEST 2005


Hi,

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?

Thanks,
Martin




More information about the R-help mailing list