[R] clean programming

From: <cgenolin_at_u-paris10.fr>
Date: Sun, 16 Dec 2007 15:25:20 +0100

Hello the list,

I am trying to write a "cleanProgramming" function to test the procedure I use. For example, I want to be sure that I am not using globals variables. The function "findGlobals" detect that.

To list the globals used in function "fun", the syntax is : "findGlobals(fun,FALSE)$variable"

My problem is that I want to use it in a function, something like :

cleanProg <- function(name){
  if(length(findGlobals(name,FALSE)$variable>0){     cat("Warnings: there is globals is function ",name,"\a\n")   }

But findGlobals take a function as first argument, not a variable containing a function name.

Anyway to solve that?


Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre

R-help_at_r-project.org 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 Sun 16 Dec 2007 - 14:35:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 16 Dec 2007 - 15:30:19 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.