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

______________________________________________
R-help@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.

Reply via email to