Hi I need to optimize the below function:
a=function(x){ A=x[1] B=x[2] C=B-A return(C) } I need to optimize the above function such that x can be any combination of these number (0,3,5,8) of vector length 2 (i.e) x can be (3,0), (5,0), (8,0), (3,5), (3,8), (5,8), ...... etc can someone please help me solve this problem ? -- View this message in context: http://r.789695.n4.nabble.com/Optimize-a-function-with-Discrete-inputs-tp4638644.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.