[Rodbcext-commits] r8 - pkg/rodbcExt/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 26 04:27:08 CET 2009


Author: jaunario
Date: 2009-02-26 04:27:08 +0100 (Thu, 26 Feb 2009)
New Revision: 8

Modified:
   pkg/rodbcExt/R/closeExt.R
Log:
added specification of environment. .GlobalEnv is default.

Modified: pkg/rodbcExt/R/closeExt.R
===================================================================
--- pkg/rodbcExt/R/closeExt.R	2009-02-25 05:43:30 UTC (rev 7)
+++ pkg/rodbcExt/R/closeExt.R	2009-02-26 03:27:08 UTC (rev 8)
@@ -3,15 +3,15 @@
 # Version 0.1.1  
 # License GPL3
 
-cleanDisconnect <- function(channel, rmv=T){
+cleanDisconnect <- function(channel, rmv=T, env=.GlobalEnv){
     odbcClose(channel)
     if (rmv){
-        objs <- ls(envir=.GlobalEnv)
+        objs <- ls(envir=env)
         for (obj in objs){            
-            cobj <- get(obj, envir=.GlobalEnv)
+            cobj <- get(obj, envir=env)
             if(is.atomic(cobj)|is.list(cobj) ){
                 if (cobj==channel){
-                    rm(list=obj, envir=.GlobalEnv)
+                    rm(list=obj, envir=env)
                 }
             }
         }   



More information about the Rodbcext-commits mailing list