These functions are different.
get
searches for an object in the environment, as well as enclosing frames (by default):
From ?get
:
This function checks if the name x has a value associated with it in the specified environment. If TRUE inherits and the value is not found for x in the specified environment, the environments surrounding the environment are searched until the name x is found. See the Environment section and the R Language Definition Guide for more information on the structure of environments and their enclosures.
In contrast, the [
operator does not search for the default environment.
From ?'['
:
Both $ and [[can be applied to environments. Only character indexes are allowed and no partial match is performed. The semantics of these operations are get(i, env=x, inherits=FALSE)
operations.
source share