Message-ID: <4f7bf0100904270841w29d588d5ufa5a3ebd7b8f7cc1@mail.gmail.com>
Date: 2009-04-27T15:41:20Z
From: Steve Weston
Subject: snow: export data inside function and check worspaces
In-Reply-To: <111060c20904262353l5e5aad27v9ea80418047c5faf@mail.gmail.com>
On Mon, Apr 27, 2009 at 2:53 AM, Matthieu Stigler
<matthieu.stigler at gmail.com> wrote:
> 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.
If you want to use clusterExport, I believe you would have to
first assign the value of the local variable to a global variable,
since that is the only thing that clusterExport will operate on.
You might want to consider other methods of handling that
data, though.
> 2 How do I check the objects sent? I tried clusterCall(cl, ls()) but gives
> me character(0)
Try something like:
clusterCall(cl, function() ls(globalenv()))
--
Steve Weston
REvolution Computing
One Century Tower | 265 Church Street, Suite 1006
New Haven, CT 06510
P: 203-777-7442 x266 | www.revolution-computing.com