a) How can I set the recording of all windows()-history forever to "true"? I want something like windows(record = TRUE) but not just for the window that opens then, but for all windows I will open ever. b) Scrolling up in RGui (windows 2000) to see past commands is nice, but: Is it possible to type eg "wi" and the "arrow up" and see the last command that started with "wi" (like windows()). I know this feature from Matlab (Uops, one of the forbidden words here? ;) ) and it's nice to have it. Thomas
On 3/23/2006 7:35 AM, Thomas Steiner wrote:> a) How can I set the recording of all windows()-history forever to > "true"? I want something like windows(record = TRUE) but not just for > the window that opens then, but for all windows I will open ever.options(graphics.record=TRUE) will make that happen for the rest of the session. To really make it happen forever, you need to put this line in your Rprofile (see ?Rprofile for where that comes from). Watch out though: the graphics history is stored in your current workspace in memory, and it can get big. You might find you're running out of memory if you store everything, and you'll find your .RData files quite large if you save your workspace. On my todo list (but not for 2.3.0) is the possibility of setting a default history length, perhaps defaulting to saving the last 2 or 3 pages.> b) Scrolling up in RGui (windows 2000) to see past commands is nice, > but: Is it possible to type eg "wi" and the "arrow up" and see the > last command that started with "wi" (like windows()). I know this > feature from Matlab (Uops, one of the forbidden words here? ;) ) and > it's nice to have it.We have things like that on platforms that use the readline library for input, but Rgui doesn't. It would be nice, but it's a fair bit of work to implement properly and it's not on my todo list. Duncan Murdoch
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??!! 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 scieng.flinders.edu.au/biology/people/mackay_d/index.html [[alternative HTML version deleted]]
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 > > scieng.flinders.edu.au/biology/people/mackay_d/index.html > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! R-project.org/posting-guide.html
Duncan Murdoch
2006-Mar-25 05:22 UTC
[Rd] Help please: please test timestamping of command history
[ Moved from R-help] 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've written a timestamp() function to do the timestamping, but I'd like some people on platforms other than Windows to take a look -- I can't test it there. I'd especially like to hear if trying it on platforms that don't support history() causes problems. This needs new internals, so you need to be able to build R to test. If anyone has the time, could you try applying the attached patch to a reasonably current R-devel source tree, and send me comments or make improvements? Thanks. Duncan Murdoch -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch Url: stat.ethz.ch/pipermail/r-devel/attachments/20060325/9337e93d/attachment.pl
Martin Maechler
2006-Mar-27 06:47 UTC
[Rd] Help please: please test timestamping of command history
[from a semi-private diversion of the R-devel thread ]>>>>> "Duncan" == Duncan Murdoch <murdoch at stats.uwo.ca> >>>>> on Sat, 25 Mar 2006 12:28:30 -0500 writes:Duncan> On 3/25/2006 11:30 AM, Martin Maechler wrote: >> Hi Duncan, >> >> I think all ESS users don't use history() because ESS >> calls R with "--no-readline" (Unix) or "--ess" (Windows & >> Cygwin) >> >> I'd wish that in that case, and probably also in BATCH >> mode, timestamp() should write the time stamp prefixed by >> "##" to the "R console" (to R's stdout); when people are >> using ESS properly, then rather than wanting a history, >> they save the R's buffer ("*R*") as "R transcript" (file >> typically ending with ".Rt" or ".Rout") and it makes much >> sense to have a time stampe entry in that file when >> others would want an entry in the history. Duncan> Thanks, that's a good suggestion. Do you know what Duncan> the test is for this state, in either R or C code? Duncan> capabilities() doesn't do it. Does ESS make itself Duncan> known to R code somehow? Yes, when ESS starts R (or S+) , it also issues options(STERM='iESS') and we (ESS core) thought that other GUIs / IDEs ideally should also set "STERM" - which AFAIK hasn't been adopted widely. hence if ( identical("iESS", getOption("STERM")) ) { ## are running 'inside ESS' } should be pretty reliable. Martin