In the spirit of reproducible research, here we share the data and the computational code used for carrying out the analyses presented in our paper “Robust soil mapping at the farm scale with vis-NIR spectroscopy” which is by the way open access. Before you go thorugh this code we strongly recoment to read our paper.