Skip to content

"Masked by GlobalEnv"

3 messages · Ashok Parmar, Uwe Ligges, S Ellison

#
On 12.08.2012 04:54, Ashok Parmar wrote:
Please read the posting guide that suggests how to ask questions in a 
way that we can answer. Your code is not reproducible for us, we do not 
have the data nor do we know whjat you actually expect.

Uwe Ligges
1 day later
#
One generally useful piece of advice would be to avoid using 'attach'.
Instead, try 'with'
Amend your data frame, and then do something like

with(machm, plot(xmach,ymach, xlim=c(-5,5),ylim=c(-5,5), pch=19, cex=area*0.05,col=coll))

That will make sure that the items mentioned in the plot() call are taken from the data frame that you have just amended.


In your original code, you attached the data frame, making a copy of its contents available to the global environment, then you modified the attached version of the data, and then told the plot() command to use the original (unamended) data in the data frame. 
That is an easy mistake to make when using 'attach', and a good example of why it's better to use 'with' instead of being unsure which copy of the data is in use.
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}