First check the working directory ( getwd()
). savehistory()
saves the history in the current working directory. And frankly, you'd better specify the file name, since the default is .History
. Say:
savehistory('C:/MyWorkingDir/MySession.RHistory')
which allows you to:
loadhistory('C:/MyWorkingDir/MySession.RHistory')
So, the story is not lost, it is just in place and under a name that you did not know about. See Also ?history
.
To clarify: history is nothing more than a text file containing all the commands of this current session. So this is a good journal of what you have done, but I almost never use it. I myself create my "analysis log" using scripts, as another answer hinted at.
source share