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_getNearestLocation(locationTbl, lon, lat, distanceThreshold = 50) %>% str()
# Expanding the distanceThreshold will find one
table_getNearestLocation(locationTbl, lon, lat, distanceThreshold = 5000) %>% str()
Run the code above in your browser using DataLab