Code snippets in R for training in risk modelling