I am using the nearest function to find nearest genomic range but it doesn't seem to return the correct result when I have a large list for subject.Reproducible example below. Here when using all subjects we get the 14093 as the nearest but actually it should be 14094. When testing just 14093 and 14094 this returns the correct result of 2 e.g. 14094
I have uploaded "grangestest.Rdata" to here https://collect.qmul.ac.uk/down?t=61123FRTCMKNEFIQ/59SHP073IU3MOA20452291G (available for 14 days).
#But 14094 is closer as this returns 2