Add R script to generate the farmref file