Let\'s assume that we have a data frame x
which contains the columns job
and income
. Referring to the data in the frame normally requi
If you execute attach(data)
multiple time, eg, 5 times, then you can see (with the help of search()
) that your data has been attached 5 times in the workspace environment. So if you de-attach (detach(data)
) it once, there'll still be data
present 4 times in the environment. Hence, with()/within()
are better options. They help create a local environment containing that object and you can use it without creating any confusions.