Here are the R scripts for the second edition of Extending the Linear Model with R (2016).

or get them all as ELM2scripts.zip.