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/R
Look 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
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.