-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose more foreach settings #33
Comments
To fix this I would add a parameter foreachPars to l*ply functions. Within llply a small change would be need in the call to foreach:
changes into:
I think this should work in the way I intend it...the use would be:
The advantage would be that all foreach parameters can be used in a call to ldply without adding all the parameters explicitely to ldply. |
I have a fix for this issue which involves no changes to plyr. Once a cluster is active, one can use clusterExport to load variables into the workers. An example:
The same approach is possible for libraries (found this on stackoverflow):
I was far too much obsessed with solving this within foreach, while the solution was already there by loading stuff directly into workers :). |
The following example includes an extended version of 'createCluster' which supports passing on objects to export and libraries to load. It requires an adapted version of clusterExport because it needs to find the variable to be exported not in the .GlobalEnv, but in the environment of the function.
|
Duplicate of #84 (closing this one because there's more discussion there). |
e.g. (from Paul Hiemstra)
The text was updated successfully, but these errors were encountered: