Being the data and visualization nerd that I am, I’ve been delving into R on occasion.  For this purpose, I am using on my Mac.  To start it up for a certain working directory (to keep different projects separate), I run “open -a R <working dir>".  This worked great until I noticed that my history wasn’t getting saved to the .Rhistory file in each directory.  When I use the command line R executable it does, but not in the GUI.

So, it took me a little while to figure out that it’s a bug in the code and you have to use a workaround.  Open’s preferences and set the “R history file” key to something other than “.Rhistory”:


Now, after a restart, the .nateRhistory file in the working directory is properly updated.