Fossil occurrence data downloaded from the Paleobiology Database (PBDB), no matter how exact you with choosing the criteria on the download form, can often still contain occurrences that are not useful. The script provides a step by step procedure for 'cleaning' data i.e. eliminating unwanted occurrences. Here, I download fossil occurrences directly to a .csv file using the download form. Alternatively, data can be downloaded directly into R from the API (documentation for this can be found here), or by using a package such as paleobioDB or velociraptr.