R global variables.
This is one of the annoying features of R. What it means is this. You defined a function. And accidentally there is an undefined variable in the function. Then R does not stop but keep looking for the variable and use one if there is one in the environment that called the function. It makes debugging very hard.
Here is how to minimize it.
1. Use codetools to scan your function.
2. Use a prefix for all your variables in a function so that any mistakes can be seen easily.
Hope to write more about it later but now, just want to post a solution.