Instructions to run the R code. To run this code, some files are required: a) a shapefile with a given administrative division, b) a csv file with the number of farms and animals for the same administrative divisions, and c) an ID code to join both are needed. This code, provided that the above files are available, allows you to simulate the random location of each farm within each administrative division, and then join them to produce a spatial object with the location of each farm in the country. It also allows you to simulate the spread of a disease, from a farm randomly selected among the farms in the country, at a given time speed, for a predefined time. For our study, the shapefile of France (administrative level 2) was obtained from https://gadm.org/download_country_v3.html, which as it is indicated “data are freely available for academic use and other non-commercial use”. The shapefile required to run the code can be downloaded there. The data for the number of farms and animals for the same administrative level 2 divisions used for the study was provided by the French Government. Therefore, the same dataset is not freely accessible to people. However, we provide a “self-made dataset” in which we fixed the number of farms and animals to 500 and 5000, respectively, for all the Departments of France, but which allows to join the shapefile and the cvs file and run the code (CENSUSDATA.csv). The numbers in the cvs file may be changed for simulation purposes. Even the code may be applied to a different geographical area if the shapefile, the csv file and the ID code to join both are provided.