Error when running many_models()
Opened this issue · 4 comments
Error occurred when I run the following code:
stm_models <- many_models( K = 3:12, documents = out$documents, vocab= out$vocab,
prevalence = ~ treatment + s(pid_rep), data = out$meta, N = 4, runs = 100 )
Running multiple STM models [------------------------------------------] 0 of 10 ( 0%) finished Error in mclapply(K, selectModel2, args, verbose, pb, mc.cores = cores, :
'mc.cores' > 1 is not supported on Windows
Any idea to fix it on Windows laptop? Thanks in advance.
Thank you for bringing this to my attention and sorry the late reply. I did not know that mclapply
did not work on windows. I'll rewrite the function with an other parallel backend that also works for windows this week.
It has been a while, so this probably fell off the radar, but is there any update on this one?
Thank you for following up. I haven't decided how to tackle this yet. The function is based on parallel::mcapply()
--the same as the stm
packages uses for parallelization---which does not support windows. Parallelization on windows is more cumbersome. Any ideas? For now it works, of course, if you just set cores = 1
.
hm... I feared it wasn't as easy as inserting a if( Sys.info()[['sysname']] == 'Windows')
into the function... There is an old post (hack doesn't work for me) here . Other than that, this goes beyond my high-level programming skills... if you find a solution let me know. In the meantime, I think I'll just run this on the linux subsystem for windows.