Re: [R] maximum/minimum value of a function

2009-07-11 Thread Barry Rowlingson
On Sat, Jul 11, 2009 at 6:24 AM, milton ruser wrote: > my.values<-myfunction(1,10,100) > min(my.values) > max(my.values) That finds the minimum and maximum of a limited sample from a univariate function. Extending this method to ten dimensions might be a bit tricky... If you want to find the mi

Re: [R] maximum/minimum value of a function

2009-07-10 Thread milton ruser
Hi Derek, like this? myfunction<-function(xmin, xmax, number_of_values) { xvalues<-seq(from=xmin, to=xmax, by = ((xmax - xmin)/(number_of_values - 1))) outputvalues<-xvalues^2+(xmax/xvalues)^3*runif(number_of_values) return(outputvalues) } my.values<-myfunction(1,10,100) min(my.values) max(m

[R] maximum/minimum value of a function

2009-07-10 Thread Derek An
Dear All, Does anyone know how to get the maximum/minimum value of a function using R, I think there should be an instruction, but i can not find it in help files Thank you in advance for your help :) [[alternative HTML version deleted]] __ R