I got this question while doing some practicals using R. So here is the scenario,
v = list(bob=c(2,3,5),bob=c("aa","bb"))
I have a list named v and there are two list elements both named as bob. When I compile this it does not give any error. But the most interesting factor is if I try to print bob using list name it gives me this result,
> v$bob
[1] 2 3 5
But if I print bob using attach() command it returns another way around.
> attach(v)
> bob
[1] "aa" "bb"
> detach(v)
These two different results made me curious and please can someone help to understand the underline theory.