[R] Apparent namespace problem

Ross Boylan ross at biostat.ucsf.edu
Sat Apr 26 00:49:55 CEST 2003


I'm seeing some strange behavior while using the snow package for
networked computers.  I believe it's caused by name space resolution
issues, and would appreciate any suggestions tracking it down.

First, is there a way to find out what frame (as in frames in
environments, not data frames) a name is being obtained from or put
into?

Second, how closely does the evaluation environment in the
browser/debugger match what you would get in the function at the same
point?  I ask because if I evaluate a statement in the browser it
seems to work one way, but if I execute it it works another way.

The statement is
clusterEvalQ(cl, crossval.setup(x, y, groups, theta.fit,
theta.predict))

This evaluates the crossval.setup function across the cluster cl.

crossval.setup is a function which puts its arguments in a list g (a
local variable) and then does gcv <<- g.  The intent is to stuff the
data into a global variable for use by later function calls.

When I execute the statement interactively, even in the debugger in
the function that executes the statement, it seems to work.  But if it
executes in the function, gcv appears to remain unset.

I assume gcv is getting set in some other frame, but where it is and
how to track it down I don't know.

In an effort to get around this I did gcv <- list() in the global
namespace (on the distributed nodes), but this doesn't seem to help.
I'm just left with the empty list, even after calls to crossval.setup.

Any ideas?

Thanks.



More information about the R-help mailing list