Re: [R] find max. value for a equation by optimize

2015-10-29 Thread Jianling Fan
Oops! Thanks a lot! Jean On 29 October 2015 at 15:45, Adams, Jean wrote: > If you read the help file for optimize, you will see that you need to set > the argument maximum to TRUE. > > ?optimize > > optimize(sm, c(0, 50), maximum=TRUE) > > Jean > > On Thu, Oct 29, 2015 at 4:19 PM, Jianling Fan

Re: [R] find max. value for a equation by optimize

2015-10-29 Thread Adams, Jean
If you read the help file for optimize, you will see that you need to set the argument maximum to TRUE. ?optimize optimize(sm, c(0, 50), maximum=TRUE) Jean On Thu, Oct 29, 2015 at 4:19 PM, Jianling Fan wrote: > Hello, everyone, > > I have a specific equation, When I draw it out, I found there

[R] find max. value for a equation by optimize

2015-10-29 Thread Jianling Fan
Hello, everyone, I have a specific equation, When I draw it out, I found there is a max. value for it at about x=5. but I couldn't point it out by optimize(). Does anyone know why? Thanks! my code is: d50<-18.04 c<- -1.276 dm<-147 sm <- function (x) { 1/(1+(x/d50)^c)+(1-1/(1+(dm/d50)^c))*x/