In addition to exporting objects, you need to load the necessary packages on the cluster workers. In your case, the result of not doing so is that there isn't a dimnames
method defined for "DocumentTermMatrix" objects, causing rownames<-
to fail.
You can load packages on the cluster workers with the clusterEvalQ
function:
clusterEvalQ(cl, { library(tm); library(skmeans) })
After doing that, rownames(combi)<-ci
will work correctly.
Also, if you want to see the output from cat
, you should use the makeCluster outfile
argument:
cl <- makeCluster(2, outfile='')