I have a big looping script running in R-GUI and was curious if I can concurrently run other scripts in the same R-GUI session or can I open another session of R? Any suggestions would be great thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I often have several different instances of R running on my computer on different projects. While one is processing a script or doing a long run I can use a different one to work on another project.
While it is possible to have the same R session running multiple things concurrently (I have done this using the tcltk package) it is generally not advisable as the different projects could all access/change the same global environment which could mess things up. With multiple sessions they each have their own global environment (just be careful that they don’t overwrite files if working from the same folder/directory).
There are also packages that will help with parallel processing which may be more what you are interested in. If each step of your loop runs independent of the others (step i+1 does not depend on the results of step i) and you have multiple processors (or multiple computers) then sometimes the parallel processing can help. See the HighPerformanceComputing task view on CRAN for descriptions of these packages.