I successfully processed some data on a 4 core computer using parLapply, using a code like below:
require(\"parallel\")
setwd(\"C:/...\")
file_summary<-read.
The only operation that I see in "myfunction" that can generate a "cannot open the connection" error is "read.table". You might want to add the following right before calling read.table:
if (! file.exists(new_file))
stop(paste(new_file, "does not exist"))
It might also be useful to check that the worker has permission to read the file:
if (file.access(new_file, mode=4) == -1)
stop(paste("no read permission on", new_file))
It seems worthwhile to rule out these problems.