I use R software for statistical analysis, and I am sad that it does not save or restore my current command history. Indeed, pressing the up arrow on a recently launched interactive session R will each time show an empty history. It would be great if it could do it in a way, say, similar to ipython . I tried putting this in my .Rprofile file .Rprofile no avail. A file containing my command history is never created.
.First <- function(){ if (!any(commandArgs()=='--no-readline') && interactive()){ require(utils) try(loadhistory(Sys.getenv("R_HISTFILE"))) } } .Last <- function() { if (!any(commandArgs()=='--no-readline') && interactive()){ require(utils) try(savehistory(Sys.getenv("R_HISTFILE"))) } }
Of course this line is present in my .bash_profile
export R_HISTFILE="$HOME/share/r_libs/.history"
All this happens via SSH on a remote Linux server. Any help is much appreciated!
source share