Peng Yu
2009-Oct-08 15:21 UTC
[R] How to start R in mac with the current directory as the current working directory?
Hi, I installed R on mac (see below). When I start it from a terminal by the following command, the current working directory is always '~' no matter where my current directory is in the terminal. I'm wondering if there is a way to make the gui R on mac inherent the current directory from the terminal. /Applications/R.app/Contents/MacOS/R Regards, Peng R.app GUI 1.29 (5464 Tiger build 32-bit), S.Urbanek & S.M.Iacus, ? R Foundation for Statistical Computing, 2009
Steve Lianoglou
2009-Oct-08 15:57 UTC
[R] How to start R in mac with the current directory as the current working directory?
Hi Peng, On Oct 8, 2009, at 11:21 AM, Peng Yu wrote:> Hi, > > I installed R on mac (see below). When I start it from a terminal by > the following command, the current working directory is always '~' no > matter where my current directory is in the terminal. I'm wondering if > there is a way to make the gui R on mac inherent the current directory > from the terminal. > > /Applications/R.app/Contents/MacOS/RLook in the R > Preferences >Startup dialog under the "Initial working directory" section. You'll see you can run this from the command line in order to open R.app within a given directory: $ open -a R.app <dir-or-file> So, to open in the current directory, just type: $ open -a R.app . You can make an alias for this and set it in your .bash_profile in order to make your life easier, maybe: alias r="open -a R.app ." Small r so it doesn't interfere with /usr/bin/R Hope that helps, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact