Re: [R] R newbie example code question

From: Martin Maechler <>
Date: Wed 11 Jan 2006 - 03:31:29 EST

>>>>> "RobMcG" == McGehee, Robert <> >>>>> 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 []
> 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 mailing list PLEASE do read the posting guide! Received on Wed Jan 11 03:42:39 2006

This archive was generated by hypermail 2.1.8 : Wed 11 Jan 2006 - 06:06:40 EST