How do I interpret the output of the thin() and plotThin() functions from the spThin function in R?
12:52 17 Jun 2026

I am trying to reduce sampling bias in my presence-only dataset by spatial thinning using the thin() function of the r package spThin.

library(spThin)
thinned_dataset_full.100 <- thin(loc.data = AP.bioclim.combined.3, lat.col = "Latitude", long.col = "Longitude", spec.col = "Species", thin.par = 5, reps = 100, locs.thinned.list.return = TRUE, write.files = FALSE, write.log.file = FALSE)

This gives the following output:

 Script Started at: Wed Jun 17 16:02:22 2026
lat.long.thin.count
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 
   2    2    1    2    8   10    8   18   16   13    6    8    5    1 
[1] "Maximum number of records after thinning: 1205"
[1] "Number of data.frames with max records: 1"
[1] "No files written for this run."

Am I correct in interpreting this to mean that the largest dataset that could be generated, whereby each data point is at least 5km apart from each other, has only 1205 records and that only 1 of the 100 possible datasets generated has this number of records?

Additionally, I used the plotThin() function in order to evaluate the spatial thinning process, which generated the following three plots:

enter image description here

When it comes to interpreting these plots:

  1. For plot 1 it is my understanding that if the cumulative maximum records (CMR) increases with the number of repetitions this means that this number of repetitions is insufficient to find the dataset with the maximum number of records (it is only when the CMR increases and then plateaus that the sufficient no of repetitions has been reached). Given this, am I correct in interpreting this to mean that I need to re-run the thinning function with a greater no of repetitions?

  2. For plot 3, it is my understanding that the ideal histogram shows a peak around the highest number of retained records which confirms that the optimal dataset size is consistently achievable. Given this, am I correct in assuming that this is not the case for my dataset? Does anyone know how I might go about rectifying this?.

r maxent