R
2021
Continuous Integration (CI) is not a tool but a practice of continually merging in new behaviour/features into a released product. To facilitate this practice without exposing end users to unstable behaviour and bugs, testing needs to be standardised and automated. It’s no wonder then that CI is often associated with Test Driven Development (TDD), which mandates that you write your tests first, working backwards to the write the minimal code that should pass each test.
It’s taking a long time to run my genetic algorithm optimisation models recently. So much so that I’ve been looking at offloading processes to other computers lying idle on the network. The armr project aims to do this with parallel processing and Rstudio server docker images running on the raspberry pi but this is a work in progress currently, chiefly due to having to build Rstudio server from source.
2020
Latin hypercube sampling aims to bring the best of both worlds: the unbiased random sampling of monte carlo simulation; and the even coverage of a grid search over the decision space. It does this by ensuring values for all variables are as uncorrelated and widely varying as possible (over the range of permitted values).
I almost didn’t write this post because the topic of file organisation is incredibly boring for most people (including me). What did drive me to write was a few horrendous projects where the end result was a soup of files where much time was wasted deciphering what file was in use and where it came from. Especially for long-running projects with multiple authors, what generally results is what my previous geologist coworkers used to call “stratigraphic filing”: a time-based layering of work, within files, across versions and across a folder structure that seemed a good idea at the time.
Let’s use a built-in example within R: location of earthquakes off the island of Fiji.
Rmarkdown was a revelation to me when I was first introduced to it in SEAMS (now Arcadis Gen). I’d used Jupyter notebooks before for Python and loved the live lab notebook feel of them. Rmarkdown for R is like this but more polished, more final, more suited to a corporate or public end user. It also has a few tricks up its sleeve.
DVLA is not yet on CRAN. To install, simply run the following in R.