Christoph Lehmann
2005-Feb-15 15:33 UTC
[R] D(eval(g)) problem, since "Function `eval' is not in the derivatives table"
thanks Andy and Dimitris for your reply to my expression/eval - problem starting with the resulting expression g I need g's derivative as expression, but I get: "Function `eval' is not in the derivatives table": #function (double gamama) h <- expression((t/d1)^a1*exp(-(t-d1)/b1)-c*(t/d2)^a2*exp(-(t-d2)/b2)) # plot it t <- seq(0, 20000, by = 100) t <- t/1000 g <- expression(eval(h)/sqrt(sum(eval(h)^2))) plot(eval(g), type = 'l') g.deriv <- D(g, "t") > Error in D(g, "t") : Function `eval' is not in the derivatives table is there any way one can solve this problem? thanks a lot christoph ## -- ## parameters peak1 <- 5.4 fwhm1 <- 5.2 peak2 <- 10.8 fwhm2 <- 7.35 dip <- 0.35 b1 <- 0.9 # dispersion b2 <- 0.9 #dispersion a1 <- peak1/b1 a2 <- peak2/b2 d1 <- a1*b1 d2 <- a2*b2 c <- dip