Re: [R] own function: computing time

2012-10-11 Thread Tonja Krueger
That's perfect, thanks a lot! Tonja Gesendet: Mittwoch, 10. Oktober 2012 um 21:37 Uhr Von: "William Dunlap" An: "tonja.krue...@web.de" , "r-help@r-project.org" Betreff: RE: [R] own function: computing time Your original method w

Re: [R] own function: computing time

2012-10-10 Thread William Dunlap
n > Behalf > Of William Dunlap > Sent: Wednesday, October 10, 2012 9:52 AM > To: tonja.krue...@web.de; r-help@r-project.org > Subject: Re: [R] own function: computing time > > No, the desired points are not a subset of the convex hull. > E.g., x=c(0,1:5

Re: [R] own function: computing time

2012-10-10 Thread Jan van der Laan
Did not see a simple way to make it faster. However, this is a piece of code which can be made to run much faster in C. See below. I don't know if you are familiar with running c-code from R. If not, the official documentation is in the R Extensions manual. However, this is not the most easy

Re: [R] own function: computing time

2012-10-10 Thread William Dunlap
; r-help@r-project.org > Subject: RE: [R] own function: computing time > > Are the points you are looking for (those data points with no other data > points above or to the right of them) a subset of the convex hull of the > data points? If so, chull(x,y) can quickly give you the p

Re: [R] own function: computing time

2012-10-10 Thread William Dunlap
Are the points you are looking for (those data points with no other data points above or to the right of them) a subset of the convex hull of the data points? If so, chull(x,y) can quickly give you the points on the convex hull (typically a fairly small number) and you can look through them for th

Re: [R] own function: computing time

2012-10-10 Thread Rui Barradas
Hello, 'outer' is a bad name for a function, it's already an R one. See ?outer. As for your algorithm, it runs quadratically in the length of x and y so you should expect a quadratic time behavior. What are you trying to do? Your code gets max(x), max(y) and some other points near those. Can yo