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]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to