> I don't see why one would want to pretend that the function is continuous. It isn't. > The x variable devices is discrete. > Moreover, the whole solution space is small: the possible solutions are integers in the range of maybe 20-30.
Yes, you are right, what I'd like to think is that the outcome is a discretization of a continous variable. How could it be? Dont know... forget we are talking about phisical devices, would it be posible/rational to speak of "half a device"? Anyway, I have to test different approaches to find a convenient solution, I must admit that I like the idea of using a fixed criteria of a percentage % as you suggested, but it needs some research to see if it is possible to find a common criterion to all my dataset, or at least if the criterium can be based upon the number of devices, as I tried the last time I thought on it: criterion<-devices/10 solution<-min(devices[diff(percentages)<criterion]) Regards, Jose Lozano ______________________________________________ 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.