Skip to content

Rconsole wishlist

4 messages · Liaw, Andy, Duncan Mackay, Kjetil Halvorsen +1 more

#
I'm guessing you're talking about Rgui on Windows, but please don't leave us
guessing.

If you run R under Ess/(X)Emacs, you have the entire session that can be
saved in a (transcript) file.

Does your OS not put date stamps on file?
size isdir mode               mtime               ctime
.Rhistory 1025 FALSE  666 2005-03-03 19:27:31 2004-08-13 10:45:09
                        atime
.Rhistory 2005-03-03 19:27:31

Andy
http://www.scieng.flinders.edu.au/biology/people/mackay_d/index.html
  



______________________________________________
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
#
Sorry, yes, Rgui under WinXP (SP2). But while Windows date stamps the
history file
size isdir mode               mtime               ctime
.Rhistory 5377 FALSE  666 2005-03-04 10:37:52 2005-03-04 10:37:52
                        atime
.Rhistory 2005-03-04 13:54:11

the problem is that there can be multiple sessions stored in .Rhistory and
the session dates aren't stored there. Moreover, it seems to me that the
history buffer can also overflow without warning after long sessions or many
repeated sessions and so that you can inadvertently lose parts of your
command log. (Is this right, anyone?) Perhaps it would be preferable for R
to save each session's command history in a separate history file, along the
lines of 

.Last <- function() {
savefilename <- paste("Rhistory",date())
savefilename <- gsub(" ","_",savefilename)
savefilename <- gsub(":",".",savefilename)
savefilename <- paste(savefilename,".txt",sep="")
if(interactive())  try(savehistory(savefilename))
cat("Current history saved in file: ",savefilename,"\n")
}

but this doesn't address any overflow issues.

Duncan


-----Original Message-----
From: Liaw, Andy [mailto:andy_liaw at merck.com] 
Sent: Friday, 4 March 2005 11:14 AM
To: 'Duncan Mackay'; R-news
Subject: RE: [R] Rconsole wishlist


I'm guessing you're talking about Rgui on Windows, but please don't leave us
guessing.

If you run R under Ess/(X)Emacs, you have the entire session that can be
saved in a (transcript) file.

Does your OS not put date stamps on file?
size isdir mode               mtime               ctime
.Rhistory 1025 FALSE  666 2005-03-03 19:27:31 2004-08-13 10:45:09
                        atime
.Rhistory 2005-03-03 19:27:31

Andy
http://www.scieng.flinders.edu.au/biology/people/mackay_d/index.html
  



______________________________________________
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





----------------------------------------------------------------------------
--
Notice:  This e-mail message, together with any attachments,...{{dropped}}
#
Duncan Mackay wrote:

            
Yes. But you can define an environment variable R_HISTSIZE (or some 
similar name, do a
R site search to find. Not defined on my machine now. That should really 
be in the help file for
savehistory()) to avoid the problem.
NO. it is better to have just one file as now.

Kjetil
-- 

Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
               --  Mahdi Elmandjra
#
The problem is that the commands history is GUI-specific (there are four 
mechanisms, readline on Unix, one for the GUI MacOS X (I believe), one for 
RGui and one for rterm. And we will have to cope with both GNU and BSD 
readline shortly).  We try to keep them consistent, and that means a 
lowest-common denominator approach.

History is *not* intended to be a `command log' but a way to retrieve
recentish commands, and the console buffer is just that, a buffer.  They 
are implemented for fast access backwards and so not really appropriate 
for large logs.  If you want a session log, look at 'split' option to 
sink().

With the advent of multibyte characters (supported in R as from 2.1.0) we 
need to redesign some of this (rterm's command line will not support such 
locales for 2.1.0).  It should be possible to make the default R_HISTSIZE 
unlimited.

The console buffer is less clear: how do you want to be warned?  This 
could happen in the middle of a single print() command: it could even 
happen that a single line of output exceeds the buffer size.

Finally: R-devel is for R development issues, so if people want to pursue 
this, please move there.  (I am trying to be non-technical in this reply, 
and probably not succeeding.)
On Fri, 4 Mar 2005, Kjetil Brinchmann Halvorsen wrote: