There are two types of variables in statistical scripts – local and global.
You define local variables in a function or an environment. They help you built your function, and let your toolbox grows. The global variables are defined on a much bigger scale. They command over your entire domain, are the ones in charge of daunting, grander tasks, and applied to all environments alike.
Local variables are nimble, handy and reliable. But you tend to forget who they are after you leave the environment. Global variables take much more effort to create, manage, and organize, but they stick with you all along. Most importantly, global variables override their local counterparts. You create and implement a local function, and then it expires. Global variables never expires, but you’d better be damn sure not to duplicate them, mistreat them, or ignore them, or they will crash your program, for sure.