Jannis
2013-Apr-08 18:25 UTC
[R] codetools: checkUsage would not report the use of unbinded variables if they are binded later
Dear list members, i try to use checkUsage from codetools to test my scripts and functions for errors. The scripts warn me correctly in case I use an unbinded variable but fail to do so in case I bind a value to it after its first usage in the script. Both cases, however, would result in the same r error. For example: test = function() { b = 2*a return(b) } test2 = function() { b = 2*a a = 3 return(b) } library(codetools) checkUsage(test) checkUsage(test2) Is this a bug? Is there any way to get checkUsage to detect coding errors as in test2 ? Thanks for your help Jannis