# NOT RUN {
func0 <- function(x){ sum(sin(x)) }
## This will printout every interation or when print=X
gf <- nlmixrGradFun(func0)
## x
x <- (0:10)*2*pi/10;
gf$eval(x)
gf$grad(x)
## x2
x2 <- x+0.1
gf$eval(x2)
gf$grad(x2)
## Gives the parameter history as a data frame
gf$hist()
# }
Run the code above in your browser using DataCamp Workspace