Gabor Grothendieck <[EMAIL PROTECTED]> a écrit :
> Its a FAQ
Oups... Sorry for that.
Just to close the topic :
cleanProg <- function(name,tolerance){
if(length(findGlobals(get(name),FALSE)$variables) > tolerance){
cat("More than",tolerance,"global variable(s) in ",name,"\a\n")
}
}
cleanProg
On 16/12/2007 9:25 AM, [EMAIL PROTECTED] wrote:
> 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
Its a FAQ
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f
On Dec 16, 2007 9:25 AM, <[EMAIL PROTECTED]> wrote:
> 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
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)$vari
It is part of recent versions of R (a recommended package), so if Mr
Waller follows the advice of the posting guide, he will find it already
installed.
On Mon, 26 Nov 2007, Gabor Csardi wrote:
> Try some other mirror, or the main site:
> http://cran.r-project.org/src/contrib/Descriptions/codeto
Try some other mirror, or the main site:
http://cran.r-project.org/src/contrib/Descriptions/codetools.html
You can easily install it via
install.packages("codetools")
and then selecting an appropriate mirror.
Gabor
On Mon, Nov 26, 2007 at 08:19:39PM +, Martin Waller wrote:
> Hmm - I looked
Hmm - I looked for the codetools package on the UK(London) cran site and
couldn't find it - where can I find it please?
Martin
[EMAIL PROTECTED] wrote:
>>> library(codetools)
>>> findGlobals(power)
>
> Thanks for your answer.
> In addition, findGlobals(power,FALSE) gives the list of the globals
>> library(codetools)
>> findGlobals(power)
Thanks for your answer.
In addition, findGlobals(power,FALSE) gives the list of the globals
variables alone :
> findGlobals(power,F)
$functions
[1] "^" "{" "<-" "return"
$variables
[1] "pp"
-
See the codetools package:
> library(codetools)
> checkUsage(power)
: local variable 'p' assigned but may not be used
> findGlobals(power)
[1] "^" "{" "<-" "pp" "return"
On Nov 22, 2007 5:12 PM, Christophe Genolini <[EMAIL PROTECTED]> wrote:
> Hi all
>
> Is there any compiler f
On 22/11/2007 5:12 PM, Christophe Genolini wrote:
> Hi all
>
> Is there any compiler for R ? By compiler, I mean something that check
> the cleanliness of the code : if we declare all the variables we use, if
> we don't use external variable from a function and so on...
> For exemple, something
Hi all
Is there any compiler for R ? By compiler, I mean something that check
the cleanliness of the code : if we declare all the variables we use, if
we don't use external variable from a function and so on...
For exemple, something that will ring a bell on the following code
(saying "line 4 :
11 matches
Mail list logo