[Sciviews-commits] r163 - pkg/svTools/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 6 13:37:59 CEST 2009


Author: romain
Date: 2009-08-06 13:37:56 +0200 (Thu, 06 Aug 2009)
New Revision: 163

Modified:
   pkg/svTools/R/checkUsage.R
   pkg/svTools/R/check_namespace.R
   pkg/svTools/R/search_engines.R
Log:
pleasing R CMD check

Modified: pkg/svTools/R/checkUsage.R
===================================================================
--- pkg/svTools/R/checkUsage.R	2009-08-06 11:28:57 UTC (rev 162)
+++ pkg/svTools/R/checkUsage.R	2009-08-06 11:37:56 UTC (rev 163)
@@ -30,8 +30,10 @@
 	resetErrors( file = file )
 	
 	# silly hack to retrieve information from codetools
+	here <- environment()
+	findings <- NULL
 	report <- function( x ){
-		findings <<- c( findings, x )
+		assign( "findings", c( findings, x ), envir = here ) 
 	}
 	
 	..addError <- function( line, msg ){

Modified: pkg/svTools/R/check_namespace.R
===================================================================
--- pkg/svTools/R/check_namespace.R	2009-08-06 11:28:57 UTC (rev 162)
+++ pkg/svTools/R/check_namespace.R	2009-08-06 11:37:56 UTC (rev 163)
@@ -37,6 +37,7 @@
 	      
 	 
 	nS3 <- 0
+	here <- environment()
             
 	### parse the directives and look  for the unexpected
 	parseDirective <- function(e, srcref, p, i) {   
@@ -54,8 +55,8 @@
 					"{" = for (ee in as.list(e[-1])) parseDirective(ee, srcref), 
           "=", "<-" = {
                 parseDirective(e[[3]], srcref)
-                if (as.character(e[[3]][[1]]) == "useDynLib") 
-                  names(dynlibs)[length(dynlibs)] <<- asChar(e[[2]])
+                # if (as.character(e[[3]][[1]]) == "useDynLib") 
+                #   names(dynlibs)[length(dynlibs)] <<- asChar(e[[2]])
             }, export = {
 								exp <- e[-1]
                exp <- structure(asChar(exp), names = names(exp))
@@ -145,7 +146,7 @@
 								 if (length(spec) != 2 && length(spec) != 3) 
                   addError( message = gettextf("bad 'S3method' directive: %s", deparse(e)), 
 									   file = NAMESPACE, line = srcref[1], type = "error" )
-                nS3 <<- nS3 + 1
+                assign( "nS3", get("nS3", envir = here) + 1, envir = here ) 
                 if (nS3 > 500) 
                   addError( message= "too many 'S3method' directives", 
 									  file = NAMESPACE, line = srcref[1], type = "error" )

Modified: pkg/svTools/R/search_engines.R
===================================================================
--- pkg/svTools/R/search_engines.R	2009-08-06 11:28:57 UTC (rev 162)
+++ pkg/svTools/R/search_engines.R	2009-08-06 11:37:56 UTC (rev 163)
@@ -134,7 +134,7 @@
     } , begin+1, end-1 )
   uNames <- unique( unlist( sapply( articles, names )) )
   articles <- sapply( articles, function(x){
-    x[ uNames %wo% names(x) ] <- NA
+    x[ uNames %without% names(x) ] <- NA
     x[ uNames ]
   })
   



More information about the Sciviews-commits mailing list