code programmed in R model trucker 2 by Gustavo Giménez and Marta Marticorena