[R] Mac GUI and .Renviron

Rob J Goedman goedman at mac.com
Sat Oct 6 16:49:41 CEST 2007


As Steven mentioned,  R-SIG-Mac at stat.math.ethz.ch is a list specific  
for OSX only questions.

I think you can achieve something similar by going into the  
preference settings of R.app, select the Startup section and select  
'Source input file', de-select 'Always apply' and make the R history  
file something like 'Rhistory', no fixed path.

You can up the number of history entries, although with R.app's  
multiline history and with 'Cleanup history entries' and ' Remove  
duplicate entries in history' selected, 250 in a GUI is in many cases  
a lot.

In Finder, double-click an .R file you want to work on (or drag its  
icon onto the R icon in the Dock), R will open in the dir of the file  
and read the correct history file. It will open the double-clicked or  
dragged file in either the internal or external editor, whichever one  
is selected.

I do not think you can, without some further steps, run multiple  
R.apps at the same time. Let me know if that is critical for you.

Hope this helps,

On Oct 5, 2007, at 2:17 PM, jwegelin wrote:

> The .Renviron and .First functions do not seem to work the same way  
> on a
> Mac OS 10.4 as on a Windows XP machine.
>  From working in Windows I am used to creating a new directory for  
> each
> data analysis project. In the new directory I place
> First, an .Renviron file consisting of the following text:
> R_HISTFILE="history.txt"
> R_HISTSIZE=1000000
> Second, an .RData file containing a .First function designed for the
> particular project.
> Then each project has, in its own directory, its own history.txt  
> file of
> practically unlimited size recording each command I type; I can open a
> separate instance of R for each project by doubleclicking .RData in  
> the
> appropriate directory; and the .First function for a particular  
> project
> is run automatically each time I doubleclick .RData in the  
> directory for
> that project.

More information about the R-help mailing list