[R] R newbie example code question

Martin Maechler maechler at stat.math.ethz.ch
Tue Jan 10 17:31:29 CET 2006


>>>>> "RobMcG" == McGehee, Robert <Robert.McGehee at geodecapital.com>
>>>>>     on Tue, 10 Jan 2006 10:55:47 -0500 writes:

    RobMcG> Hello,
    RobMcG> Why not just copy and paste the examples from the help pages? No need to
    RobMcG> type anything.

    RobMcG> However, if you'd like to run the entire help section for a function,
    RobMcG> check out the example function, i.e.:

    >> example(plot)

    RobMcG> Robert

Hmm, since this thread seems to perpetuate ..
let me take the opportunity to explain how enormously nicely (:-)
this is achieved in ESS (Emacs Speaks Statistics):

1) ?plot opens a separate emacs buffer with the help page.
2)       and emacs gains a separate "ESS-help" menu.

3) From that menu you can learn that you can very quickly move
   around in the help buffer using "n"(ext) and "p"(revious) or
   skip to a section via  "s <letter>."
   Now the most used keystroke in ESS help buffers I use is 
   "s e" := "[S]kip to the [E]xamples section".

4) Inside the examples section, 'l' (single lowercase "L" for [L]ine)
   sends single lines to the running *R* process, or 'r' sends a
   whole [R]egion (that you typically have marked with the mouse).


Since it seems that there are ESS users who don't know about
this feature, I'm also CCing this to ESS-help.

(and yes, I could go on: You can also send code from the
 examples when *editing* the *.Rd  (R help) files ...)

Martin Maechler, ETH Zurich


   > -----Original Message-----
   > From: Mark Leeds [mailto:Mleeds at kellogggroup.com] 
   > Sent: Monday, January 09, 2006 1:20 PM
   > To: R-Stat Help
   > Subject: [R] R newbie example code question

   > Sometimes I print out a package
   > and read about it and there
   > are sometimes nice examples
   > that I would like to run myself.
 
   > Is there a way to bring them
   > into R from the package or
   > are they only meant to be typed
   > in manually ? If manual is the
   > only way, that's fine. I was
   > just checking whether there was
   > a quicker way. Thanks.
 
   > Mark




More information about the R-help mailing list