I have been using separate environments to partition my data and functions
into logical groups but I have been having an odd (to me) problem.
To load and manipulate the data environments, I wrote a couple of small
functions (see below). The problem seems to be that when I initially try to
load the environment, often no data can be found but if I repeat the
function call, it then works.
It appears that the CreateEnv function sometimes returns a different
environment value than as.environment does. Not always, this is puzzling. I
discovered this by saving the returned value. That environment contains the
Can someone tell me where I am going wrong?
# return a named environment or, if needed, create and attach it