[R] RGui: windows-record and command history

Duncan Murdoch murdoch at stats.uwo.ca
Fri Mar 24 14:18:34 CET 2006


On 3/23/2006 9:11 PM, Duncan Mackay wrote:
> Hi all,
> On the subject of histories, how about changing the default value of
> "max.show" from 25 to Inf? I find that the line of code I'm looking for is
> ALWAYS on the 26th line back from the end of the default history!! Also, re
> changing the amount of history saved, Prof Ripley replied to an earlier
> query of mine on this list (04 Mar 2005) with info about the R_HISTSIZE
> environment variable that can be changed to save more or less history. And
> it wouldn't it be great if the history mechanism had the option of storing
> the session date??!!

I think you can change max.show in your own Rprofile.  For example,

history <- function (max.show = Inf, reverse = FALSE) 
utils::history(max.show, reverse)

I think being able to add a timestamp to the history is a good idea. 
Even more ambitious would be to put timestamps on all commands, and 
allow the history() function to select what to display according to the 
time.

I'm not very ambitious lately, but I'll see if I can at least get 
comment timestamps into r-devel.  I'm thinking of something like this:

The user executes a timestamp() function, and a comment like the result 
of cat(paste("#", date(), "\n")) is put into the history.

I haven't looked into the source yet, but I am a little worried by this 
in the Windows man page ?history:

      There are several history mechanisms available for the different R
      consoles, which work in similar but not identical ways.  Other
      uses of R, in particular embedded uses, may have no history. This
      works in Rgui and interactive Rterm but not in batch use of Rterm
      nor in embedded/DCOM versions.

This may end up only being feasible in some of these history mechanisms, 
which would be unfortunate.

Duncan

> 
> Cheers,
> Duncan
> 
> 
> 
> *****************************************
> Dr. Duncan Mackay
> School of Biological Sciences
> Flinders University
> GPO Box 2100
> Adelaide
> S.A.    5001
> AUSTRALIA
> 
> Ph (08) 8201 2627    FAX (08) 8201 3015
> 
> http://www.scieng.flinders.edu.au/biology/people/mackay_d/index.html
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list