

Hi R-community:
I heard 'snow' package is a good tool to parallelize processes and speed them up. I tried to use it but was not successful. Could someboy point where I was wrong? Thanks.
I want to read a HUGE file to R and hope 'snow' helps me to speed it up. Here are codes:
library(snow)

iFile = 'BIG.FILE.txt'

numCluster = 4;
readFile = function(file)
{
    orig_d = read.delim(file);
    orig_d;
}
cl = makeCluster(numCluster, type = "SOCK");
x = clusterApply(cl, readFile, iFile);

I got the error

Error in x[[i]] : object of type 'closure' is not subsettable

I also tried to read multiple files once

filenames = rep(iFile, numCluster);
x = clusterApply(cl, readFile, filenames);
stopCluster(cl);

and got the same error

Thanks you for your help.
HXD






	[[alternative HTML version deleted]]

