multiple independent R sessions in Mac OS X
Asked Answered
T

4

28

I need to run multiple R sessions, and hope that they can be performed in different R sessions. In Windows, I am able to open an arbitrary number of R sessions, and run different codes in each session (both RGui and RStudio). However, in Mac OSX, neither R.app nor RStudio would allow me to open multiple independent sessions -- I have to wait until the first set of R codes are completed in order to run a second set of R codes.

Is there any solution in Mac OSX? This issues had bothered me long ago, so I'd like to hear your suggestions. Thanks!

Tabbi answered 2/11, 2013 at 22:20 Comment(9)
You can run multiple sessions on the command line, using Terminal or iterm, etc.Blanca
@ScottChamberlain: thanks! I didn't thought about that... is it the only solution in Mac?Tabbi
You can always just run R from the command line to get as many sessions as you want. You can also install emacs and ess, which will also permit multiple sessions.Doit
@Tabbi I don't know of other solutions. If I need multiple sessions I always use the command line via iTerm (a bit nicer than using the standard terminal appBlanca
You can duplicate the entire R.app package by option-dragging (and you can rename the copies). Haven't tried this with RStudio.app.Bouchard
open -n /Applications/RStudio.app in TerminalKinsfolk
The easiest way to run multiple rstudio sessions is to use projects - I usually have 3 or 4 running at once.Variegate
@Variegate on RStudio-server on ubuntu & try to switch between projects I'm always asked if I want to terminate my currently running session (say, when it's in the middle of executing some code). Does the code really keep running when you switch between RStudio projects on a Mac?Unit
@Unit switching closes the old one. I think there's some limitations with projects on rstudio server.Variegate
T
49

Thank you for all the suggestions. Here is a brief summary of the possible solutions:

  1. Using Terminal: Run: open -n /Applications/RStudio.app in Terminal
  2. Install Emacs and ESS which permit multiple sessions
  3. Duplicate the entire R.app package by option-dragging (and you can rename the copies)
  4. Run multiple rstudio sessions using projects
Tabbi answered 3/11, 2013 at 16:5 Comment(1)
Small improvement to #1 (will use current working directory): open -na Rstudio .Bandy
H
19

Opens another instance of an application in OSX:

open -n -a "APPLICATION NAME"

In this case you'd just do:

open -n -a "rstudio"

CNET article source

Halle answered 16/7, 2014 at 17:45 Comment(0)
T
3

Another option for RStudio is to right click the RStudio icon of a current session and select "New RStudio Window":

enter image description here

Threadgill answered 5/1, 2020 at 19:43 Comment(0)
B
2

I use this all the time on Mac OSX to open multiple Rgui sessions (similar to the Rstudio answer above): open -n /Applications/R.app/ You can do this multiple times for as many R sessions as you want.

Barghest answered 12/11, 2014 at 14:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.