I have an environment variable `$R_HISTFILE` pointing to
`/home/my.username/.RHistory` and the following code in my `.Rprofile` in
my home directory:


    .Last <- function() {
            if (!any(commandArgs()=='--no-readline') && interactive()){
                    require(utils)
                    try(savehistory(Sys.getenv("R_HISTFILE")))
            }
    }

Still whenever I open R, and I type `history()` I can't see the commands
that I typed in earlier sessions. Moreover, the files `.RHistory` is pretty
much empty with only three lines, (not at all reflecting commands I typed
in the past).

How can I automatically save my history of commands and easily re-use them
across R sessions?

James

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to