Hi, Does anyone have any advice on speeding up R functions (short of re-implementing them in C :-) )? I have a function that applies a wilcoxon test to 12 sets of about a quarter of a million pairs (and takes about 3 hours). I've replaced the inner loop I had originally with a function call via mapply, and also considered different approximations of the wilcoxon, rather than that which is implemented in wilcox.test, but that makes little difference 9and if anything slows things down :-). Cheers, Crispin -------------------------------------------------------- This email is confidential and intended solely for the use o...{{dropped}}
Crispin Miller wrote:> Hi, > Does anyone have any advice on speeding up R functions (short of re-implementing them in C :-) )?Some strategies are in every good book on S/R.> I have a function that applies a wilcoxon test to 12 sets of about a quarter of a million pairs... and let me guess: everything is significiant to an almost arbitrary value of \alpha?> (and takes about 3 hours). I've replaced the inner loop I had originally with a function call via mapply, and also considered different approximations of the wilcoxon, rather than that which is implemented in wilcox.test, but that makes little difference 9and if anything slows things down :-).Are you using wilcox.test(), or a self written function? Uwe Ligges> Cheers, > Crispin
Seemingly Similar Threads
- FW: Optimising code
- .First.lib doesn't appear to be running after calling lib rary()
- File permissions and packages, openVignette
- Apply and its friends
- The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?