2

I'm using cluster in the R raster library to speed up the processing time when running predictions on sdm models. However, even with all available cores utilised (35), it is taking a long time. Is it possible to incorporate a progress bar so I can view it's progress? When I use predict without cluster, I can display the progress;

pb <- predict(pred_nf, bc, ext=ext, progress='text') 

However, it does not appear when I include it in the cluster

beginCluster() pb <- clusterR(pred_nf, predict, args=list(bc, ext=ext, progress='text')) endCluster() 

Does anyone have a solution to this?

1 Answer 1

2

I think you need to put the progress bar code outside of the closed parenthesis.

Try this:

 # create a cluster and ID the # of cores to use beginCluster(3) #predict fxn using clusterR r.prob.Cluster<-clusterR(logo, predict, args=list(model.RF), progress='text', type='prob') endCluster() #delete the cluster 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for this. I was able to execute the code using the below alterations. What is the purpose of the r.prob in your code?; 'beginCluster()' 'pb <- clusterR(predictors, predict, args=list(m),progress='text')' 'endCluster()'
Glad it worked -please consider accepting my answer (click the check mark) so others will know this is the solution. The r.prob.Cluster is simply the name of the output raster in my code. I was running tests generating the output with and without cluster (if interested see: timassal.com/?p=1920). The type='prob' is so the output is returned on a probability scale.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.