Re: [R] Question about managing searching path

From: vito muggeo <vmuggeo_at_dssm.unipa.it>
Date: Tue 17 Oct 2006 - 07:56:51 GMT

Dear Tong
I think on.exit() makes the job..Namely:

attach(Yourdata) on.exit(detach(YourData))

vito

Tong Wang wrote:
> Hi all,
> I'm having sometrouble with managing the seach path, in a function , I need to attach some data set at the begining
> and detach them at the end, say, myfunction<- function() { attach(mylist); ............. detach(mylist) } ,
> the problem is, since I am still debugging this code, sometimes it got error and ended before reaching the end, thus
> the data is left in the searching path.
> What 's the right way to make mylist detached no matter what ?
>
> Thanks a lot.
>
> best
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>
>

-- 
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
UniversitÓ di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Tue Oct 17 18:04:54 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 08:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.