Passing additional (default) parameters to function in emrlapply()

23 views
Skip to first unread message

David

unread,
May 16, 2011, 7:43:14 PM5/16/11
to Segue for R
Hi James,

Working here to try run my algorithm on segue.

The issue is passing a data structure to the function which is larger
(but not huge as in Big Data) than a simple index or seed in the input
list. What's unique about this data structure is that it is the same
for all calls of the function.

What I tried to do was define my function like so:

my.func <- function(i, bg = bigger.data){
# process bg using index i
}

This works well with the stock lapply() but with emrlapply() I get an
error (bigger.data not found by segue).

Of course, I can bundle bigger.data in every element of the parameter
list, but if bigger.data is fairly large then the repetition can be
stressful to the local system if the number of elements in the list is
large.

For example, snowfall has the ability to sfExport() for spreading
variables and data structures to the
cluster.

Is it possible to do what I am seeking with segue as it is?

Thank you,

David

James Long

unread,
May 17, 2011, 7:37:14 AM5/17/11
to seg...@googlegroups.com
When you createCluster() try using
rObjectsOnNodes=yourRStuff Let me know if that helps. -J
Reply all
Reply to author
Forward
0 new messages