Hi Yujean. My first guess would be that the SLiM model you're running is halting with an error, and that R is reporting that an error occurred. You can check the file where you told system2() to direct error output; or you could rewrite the call to system2() to have the running process (i.e., SLiM) send its error output to R's console instead of to a file; or you could log out all of the parameters that are being sent to SLiM through system2(), and run slim the same way with the same parameters at the command line. I can't really provide additional help on those topics, since this is an R issue, not a SLiM issue, but perhaps Sam will notice this thread and reply with further advice.
In general, because getting error messages indirectly after system2() calls is annoying, it is best to completely debug your model before you start trying to run it through an automated script like this. :->
Cheers,
-B.
Benjamin C. Haller
Messer Lab
Cornell University