Displaying 1 result from an estimated 1 matches for "do_calc".
Did you mean:
do_call
2011 Sep 24
1
Can't reliably use RefClass methods in Snowfall
...d emailing the Snowfall author, but have not heard back. Any
help is greatly appreciated!
Henry Bryant
Texas A&M University
library("snowfall")
library("methods")
# set up a simple reference class
calculator <- setRefClass("calculator")
calculator$methods(do_calc = function(x) {print(x*x)})
my_calc <- calculator$new()
wrapper <- function(x) {my_calc$do_calc(x)}
# STANZA 2: use snowfall without wrapper -- WORKING
#sfInit(parallel=TRUE, cpus=2, type="SOCK")
#sfExport("calculator")
#sfExport("my_calc")
#results <- sfLapp...