Re: [R] moving from loops to apply

2012-06-15 Thread Petr Savicky
On Fri, Jun 15, 2012 at 02:08:13PM +0200, Petr Savicky wrote: > On Fri, Jun 15, 2012 at 11:27:44AM +, Schumacher, G. wrote: > > Dear subscribers, > > > > I have made a simulation using loops rather than apply, simply because the > > loop function seems more natural to me. However, the current

Re: [R] moving from loops to apply

2012-06-15 Thread Petr Savicky
On Fri, Jun 15, 2012 at 11:27:44AM +, Schumacher, G. wrote: > Dear subscribers, > > I have made a simulation using loops rather than apply, simply because the > loop function seems more natural to me. However, the current simulation takes > forever and I have decided - finally - to learn how

Re: [R] moving from loops to apply

2012-06-15 Thread Schumacher, G.
bject: Re: [R] moving from loops to apply Hello, Simple question with reproducible example code. The best way to go is to know to what dimension you want to apply the function, the 1st, and to write the function in such a way as to have the passed rows as the first argument. If it has other argu

Re: [R] moving from loops to apply

2012-06-15 Thread Rui Barradas
Hello, Simple question with reproducible example code. The best way to go is to know to what dimension you want to apply the function, the 1st, and to write the function in such a way as to have the passed rows as the first argument. If it has other arguments, they go after. Since your functio

[R] moving from loops to apply

2012-06-15 Thread Schumacher, G.
Dear subscribers, I have made a simulation using loops rather than apply, simply because the loop function seems more natural to me. However, the current simulation takes forever and I have decided - finally - to learn how to use apply, but - as many other people before me - I am having a hard