> if i have the following function, > > f <- function(x) x^3-2*x^2+3*x-5 > > i need a simple function for the derivative of this with respect to > 'x', so that i can then sub in values to the the derivative > function, and use Newtons method of finding a root for this.
You could take a look at ?deriv, but since the example you presented is just a polymonial, you can probably learn about calculus ( http://en.wikipedia.org/wiki/Derivative#Derivatives_of_elementary_functions ) and differentiate it in your head in less time than it took you to write this help question. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.