Displaying 2 results from an estimated 2 matches for "rawhist".
2006 Apr 11
1
pattern in history
...so I modified the utils::history function for that purpose. I
found it useful.
I append the code ( I only added the two lines with #**)
Romain.
history2 <-
function (pattern="", max.show = 25, reverse = FALSE, unique =
pattern!="", ...)
{
file1 <- tempfile("Rrawhist")
savehistory(file1)
rawhist <- scan(file1, what = "", quiet = TRUE, sep = "\n")
rawhist <- rawhist[grep(pattern, rawhist, ...)] #**
if(unique) rawhist <- unique(rawhist) #**
unlink(file1)
nlines <- length(rawhist)
inds <- max(...
2002 Apr 30
1
followup -- deficiencies in readline capability
...for more information.
Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.
> debug(history)
> debug(savehistory)
> history()
debugging in: history()
debug: {
file1 <- tempfile("Rrawhist")
savehistory(file1)
rawhist <- scan(file1, what = "", quiet = TRUE, sep = "\n")
unlink(file1)
nlines <- length(rawhist)
inds <- max(1, nlines - max.show):nlines
if (reverse)
inds <- rev(inds)
file2 <- tempfile("hist&...