I have to use two functions in an R package and put them in a script to run the processes:
#!/usr/bin/env Rscript
library(pkg)
function1()
function2()
Both function 1 & 2 includes system() command to run some bash scripts. function2 needs the output from function1 as input.
The problem is when I run the above script in macOS or Ubuntu, both functions run at the same time so function2 would raise errors. I wonder if there's any way in R not to trigger function2 until function1 is done?