In PHP we can do error_reporting(E_ALL)
or error_reporting(E_ALL|E_STRICT)
to have warnings about suspicious code. In g++ you can supply -Wall
(and other flags) to get more checking of your code. Is there some similar in R?
As a specific example, I was refactoring a block of code into some functions. In one of those functions I had this line:
if(nm %in% fields$non_numeric)...
Much later I realized that I had overlooked adding fields
to the parameter list, but R did not complain about an undefined variable.