Re: [R] how to rewrite this without a loop ?

2004-11-19 Thread Stijn Lievens
Thomas Lumley wrote: On Thu, 18 Nov 2004, Stijn Lievens wrote: code add.fun - function(perf.data) { ss - 0 for (i in 0:29) { ss - ss + cor(subset(perf.data, dataset == i)[3], subset(perf.data, dataset == i)[7], method = kendall) } ss} /code As one can see this function uses

[R] how to rewrite this without a loop ?

2004-11-18 Thread Stijn Lievens
Dear Rexperts, First of all let me say that R is a wonderful and useful piece of software. The only thing is that sometimes it takes me a long time to find out how something can be done, especially when aiming to write compact (and efficient) code. For instance, I have the following function

Re: [R] how to rewrite this without a loop ?

2004-11-18 Thread Stijn Lievens
Stijn Lievens wrote: Dear Rexperts, First of all let me say that R is a wonderful and useful piece of software. The only thing is that sometimes it takes me a long time to find out how something can be done, especially when aiming to write compact (and efficient) code. For instance, I have