.Rhistory file not loaded at startup

This is how I start R on my Linux machine.

.Rprofile is in the root of my $ HOME directory and has only the following line:

source ("~/.config/r/Renviron.r") 

Then I add all types of options, variable paths, environment, or user environment aliases to the Renviron.r file. Among other lines, this path sets the path to Rhistory:

 Sys.setenv(R_HISTFILE="/developement/language/r/.Rhistory") 

The path is correct, as returned by the team

 R > Sys.getenv("R_HISTFILE") 

Following this documentation , it seems that there is no need to tell R to explicitly load the history (loadhistory ("path / to / HISTFILE"). When I run R on my terminal, there is no history.

What am I doing wrong? Thank you for your help.

+6
source share
1 answer

I found a reason why I could not load my HISTFILE. This file should have been renamed with at least one letter before .Rhistory .

 > loadhistory("path/to/.Rhistory") # loads no commands > loadhistory("path/to/R.Rhistory") # loads indeed command history 
+1
source

Source: https://habr.com/ru/post/956707/


All Articles