Hi

I have two questions for package snow:

1 How do I export object defined within a function with clusterExport()?
snow use get("object", env=.GlobalEnv) but the object within a function
belong to the function env and not globalenv if I understood well.

2 How do I check the objects sent? I tried clusterCall(cl, ls()) but gives
me character(0)

Code:
1:
fun <-function(x,cl){
 y<-x+2
fi<-function(x) x^2
res<-fi(y)

cat("Inside function:",ls(), "\n")
cat("Outside function:",ls(env=.GlobalEnv), "\n")
clusterExport(cl, "y")
return(res)
}

fun(1:100,cl)
Inside function: cl fi res x y
Outside function: cl daily fun
Error in get(name, env = .GlobalEnv) : object 'y' not found

2:
clusterExport(cl, "sunspots")
clusterCall(cl, function() ls())
[[1]]
character(0)

[[2]]
character(0)

Is the error in exporting the object or accessing to ls?

Thanks a lot!

	[[alternative HTML version deleted]]

