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.
Hi Andrew, If you use http://ess.r-project.org/ just go to the R buffer and type: C-s (CTRL + s) which will let you search through the console. You can use C-M-s (CTRL + ALT + s) if you want to search using regular expressions. Cheers, Josh On Wed, Sep 7, 2011 at 10:03 PM, andrewH <ahoerner at 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 at 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. >-- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/
Hi Andrew, maybe history() helps you? It also allows pattern search (using grep internally). hth. Am 08.09.2011 07:03, schrieb andrewH:> 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 at 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.-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. J?rg F. Debatin (Vorsitzender), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
I'm not at all certain what you wish to search: R objects? Past commands? If the latter, others have offered suggestions. If the former, what about simply ls()? Or if you mean something else entirely, please clarify. Sarah On Thu, Sep 8, 2011 at 1:03 AM, andrewH <ahoerner at 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 > > ---- Sarah Goslee http://www.functionaldiversity.org
Dear Sarah-- I am thinking mainly in terms of long programs run by cut-and-past or some other batch-like submission, where you can get back a lot of code, some program outputs, and some error messages, all in a big lump. I want tl look through that lump to locate all the error or warning messages, or all the occurrences of some variable or function that seems to be causing a problem. In both cases I want to find the result in context. Is that clearer? Thanks for your attention. andrewH -- View this message in context: http://r.789695.n4.nabble.com/Searching-the-console-tp3797884p3799611.html Sent from the R help mailing list archive at Nabble.com.
Thanks Eik! I did not know about or remember history. I agree that it solves part of my problem, but I really want to be able to search my code and the things R has printed in response as a single block of text. I can cut-and-paste it into a text editor, but I was hoping that there was a way to do it from the console itself, or otherwise cut out manual steps. Warmly, andrewH -- View this message in context: http://r.789695.n4.nabble.com/Searching-the-console-tp3797884p3799630.html Sent from the R help mailing list archive at Nabble.com.
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 <ahoerner@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]]