library(MazamaLocationUtils)
locationTbl <- get(data("wa_monitors_500"))
# Wenatchee
lon <- -120.325278
lat <- 47.423333
# Too small a distanceThreshold will not find a match
table_getNearestDistance(locationTbl, lon, lat, distanceThreshold = 50)
# Expanding the distanceThreshold will find one
table_getNearestDistance(locationTbl, lon, lat, distanceThreshold = 5000)
Run the code above in your browser using DataLab