searchhist = function(pattern){ histfile = tempfile() savehistory(histfile) myHist = readLines(file(histfile)) ret = myHist[grep(pattern, myHist)] return(ret) } searchhist('data') searchhist('^lm') searchhist('hist')
On Thu, Sep 8, 2011 at 12:03 AM, andrewH <ahoer...@rprogress.org> wrote: > Is there any way to search the console during an interactive session? I've > looked and looked, and can not find one. In some add-on package, maybe? > > Sorry to be so basic, but help would be greatly appreciated. > > andrewH > > -- > View this message in context: > http://r.789695.n4.nabble.com/Searching-the-console-tp3797884p3797884.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.