Disable saving history

前端 未结 4 2052
误落风尘
误落风尘 2020-12-15 17:37

Is it possible to disable saving command history / session in R by default ? I really hate those .RData and .RHistory files !!

4条回答
  •  不思量自难忘°
    2020-12-15 17:49

    If you are using an R gui, an alternative and quite nice approach, due to Brian Ripley, (see here), is to put the following lines in your 'R_HOME/etc/Rprofile.site' file:

    q <- function (save = "no", status = 0, runLast = TRUE)
    .Internal(quit(save, status, runLast))
    

    One note of caution: this won't work when you invoke R from the command-line. In that case, just use the --no-save argument described in @mdsumner answer.

    To learn more about 'Rprofile.site', and '.Rprofile' (an optional per-directory config file), see the always useful ?Startup help file.

提交回复
热议问题