Unlike many other programming languages, R doesn't treat variables in scopes in the same way. If you take Java or C for example, if some variable is declared in local scope, it can't be used outside of it. Usually, when process from within the scope is over, variable is deleted from memory, or in case of java prepared for deletion.
R doesn't have that kind of limitation. You can declare variable in one scope and use it in another; it's totally fine. The only way to prevent that is to perform variable deletion at the end of scope where it's created, with function rm(), where name of the variable is going to be provided as the first and only argument.
For video tutorial, check the link below.
No comments:
Post a Comment