Reformatting Code to Run in Parallel

This has been cross-posted on multiple sites simultaneously

https://www.reddit.com/r/rstats/comments/vflc0v/reformatting_code_to_run_in_parallel/

Please familiarize yourself with our cross-posting policy