R for Windows has two functions for invoking system commands. On the one hand, you can use system () (or the newer system2 () function) to execute system commands. Alternatively, you can use shell (). In my opinion, they should both do the same. What is the difference between the two?
From reading the documentation, the shell is described as a more user-friendly shell around the system. I see that both have slightly different arguments, but I really see no reason to use a shell more user-friendly. Other than that, I see no other differences and even the execution of some basic code gives the same results (except for quotation marks).
> system('ECHO "test"') test > shell('ECHO "test"') "test"
What will be the argument for using one and not the other?
takje source share