fast system calls in R <p>I have a nest for loop inside which I run a python script using the system call option in R, I found that all the execution time of my code is spent just on the system call in order to run the python script, so I was wondering if there is any tricks that I can use to save this great loss of time spent on repeatedly using the system call especially cause the python script in itself only take 1 second per each call, the problem is that I can't run the .py script independently cause I's using some parameters generated by other parts in R. here is a snapshot of my code and any suggestion is highly appreciated:</p> <pre><code> for(x in 1:10000){ ....... for (y in 1:10000){ ..... x=system("python calc.py -c1 -c2",intern = TRUE) } } </code></pre>