Re: [R] Improving performance by rewriting for loops into apply functions

2016-07-23 Thread Ranjan Maitra
Hi, The apply here does exactly what you would expect. (Your problem seems to be with the function that you have written. For some reason, you want to change the values of path2 but are passing it as a variable o a function. The global value of path2 will not change.) For that, you have to also

Re: [R] Improving performance by rewriting for loops into apply functions

2016-07-22 Thread Jeff Newmiller
If you complain to the doctor that it hurts when you ram your head into the wall, (s)he is going to tell you to not so that. What do you expect us to say? You seem full of misinformation. The apply family functions do not necessarily speed anything up... they are just more compact than for loop