[R-gregmisc-users] SF.net SVN: r-gregmisc:[1683] trunk/gdata/R/ll.R
Brought to you by:
warnes
From: <wa...@us...> - 2013-06-28 21:22:42
|
Revision: 1683 http://sourceforge.net/p/r-gregmisc/code/1683 Author: warnes Date: 2013-06-28 21:22:40 +0000 (Fri, 28 Jun 2013) Log Message: ----------- Add on.exit() handler to ensure a matching detach occurs when attach is used in ll() Modified Paths: -------------- trunk/gdata/R/ll.R Modified: trunk/gdata/R/ll.R =================================================================== --- trunk/gdata/R/ll.R 2013-06-28 20:29:06 UTC (rev 1682) +++ trunk/gdata/R/ll.R 2013-06-28 21:22:40 UTC (rev 1683) @@ -38,7 +38,7 @@ { if(length(pos) == 0) return(data.frame()) - attach(pos, pos=2, warn.conflicts=FALSE) + attach(pos, pos=2, warn.conflicts=FALSE); on.exit(detach(pos=2)) original.rank <- rank(names(pos)) was.list <- TRUE pos <- 2 @@ -79,7 +79,7 @@ } if(was.list) { - detach(pos=2) + detach(pos=2); on.exit() if(!sort) object.frame <- object.frame[original.rank, ] } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |