Recently I have been going through some old code that I needed to rerun. As part of doing so I was taking the opportunity to reimplement it with some new tricks that I have discovered since I wrote it ~2 years ago.
This particular script has many, many for loops which I now wanted to replace with purrr::map to make the code cleaner and easier to maintain.
As part of using purrr::map I wondered if I could also make the code go faster by parallelising the loop.
Read more →
This came up in my twitter feed from Rbloggers and looks pretty useful as a set and forget type thing.
See https://www.r-bloggers.com/speeding-up-package-installation-2/ for the actual post
Basically, install.packages() uses the environment setting for Ncpus, which by default is set to 1.
The current setting can be found with
# the second argument returns 1 if Ncpus is not set, instead of NULL getOption("Ncpus", 1L) Ncpus can be set with this command before running install.
Read more →