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
ject.org > Subject: [R] own function: computing time > > Hi all, > > I wrote a function that actually does what I want it to do, but it tends to > be very slow for > large amount of data. On my computer it takes 5.37 seconds for 16000 data > points and > 21.95 s

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

[R] own function: computing time

2012-10-10 Thread tonja . krueger
Hi all, I wrote a function that actually does what I want it to do, but it tends to be very slow for large amount of data. On my computer it takes 5.37 seconds for 16000 data points and 21.95 seconds for 32000 data points. As my real data consists of 1800 data points it would take ages to u