Do variables exist?
If R cannot find a variable in the current environment, it will look in the parent environment, then the grandparent environment, and so on until it finds it.
rsa_env has been modified so it includes capitals and national_parks, but not population.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Introduction to Writing Functions in R
अभ्यास निर्देश
- Check if
populationexists inrsa_env, using default inheritance rules. - Check if
populationexists inrsa_env, ignoring inheritance.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Compare the contents of the global environment and rsa_env
ls.str(globalenv())
ls.str(rsa_env)
# Does population exist in rsa_env?
___("___", envir = ___)
# Does population exist in rsa_env, ignoring inheritance?
___