Skip to content

cleaning up after example()

6 messages · Liaw, Andy, Brian Ripley, Michel ARNAUD +3 more

#
Dear R-help,

I find the example() function is extremely useful in many ways.  However,
there's a minor inconvenience: for long examples, it leaves lots of objects
in the workspace.  While it's sometimes useful to have the objects around
for further exploration, other times they just add to the clutter.  Does
anyone have a good way of cleaning up afterward?  If not, would R core
consider adding such a feature?

Cheers,
Andy


------------------------------------------------------------------------------
#
On Mon, 16 Dec 2002, Liaw, Andy wrote:

            
It's half there.  Example calls source, and source has a local argument
that by default uses the workspace for objects.  We just need to call
source(local=TRUE) in example(), and then the objects will get created in
the frame of the example call.

This BTW is to avoid creating the objects, not cleaning up.  It is not
possible (AFAIK) to find out what objects have been created, nor to know
if they clobber existing objects of the same name.
#
Hi
I would like to plot hist and density associated on the same graph.
I don't find the code.
Any suggestions ?

--
Michel ARNAUD
CIRAD TA60/15
73, av. Jean Fran?ois Breton
34938 MONTPELLIER CEDEX 5
tel : 04 67 59 38 34
Fax : 04 67 59 38 38

-------------- next part --------------
A non-text attachment was scrubbed...
Name: michel.arnaud.vcf
Type: text/x-vcard
Size: 204 bytes
Desc: Carte pour Michel ARNAUD
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20021217/133d56c2/michel.arnaud.vcf
#
Hello,

Yes, you have some examples in the "histogram" command in the lattice
library.

Regards,
Carlos.

-----Mensaje original-----
De: r-help-admin at stat.math.ethz.ch
[mailto:r-help-admin at stat.math.ethz.ch]En nombre de Michel ARNAUD
Enviado el: martes, 17 de diciembre de 2002 15:38
Para: 'r-help at stat.math.ethz.ch'
Asunto: [R] hist and density on the same plot


Hi
I would like to plot hist and density associated on the same graph.
I don't find the code.
Any suggestions ?

--
Michel ARNAUD
CIRAD TA60/15
73, av. Jean Fran?ois Breton
34938 MONTPELLIER CEDEX 5
tel : 04 67 59 38 34
Fax : 04 67 59 38 38



_____
The information in this email is confidential and it may not be\ ... [[dropped]]
#
Andy,
  One quick fix would be to take a snapshot of your current workspace,
then delete anything new afterwards. Of course, this doesn't account for
overwritten variables.
...
Regards,
Sundar