R/nearest_stations_ogimet.R
nearest_stations_ogimet.RdReturns a data frame of meteorological stations with their coordinates and distance from a given location based on the ogimet webpage. The returned list is valid only for a given day.
country name; It is possible to provide more than one country combined into a vector
optionally, a day when measurements were done in all available locations; Sys.Date used by default
logical - whether to draw a map for a returned data frame (requires maps/mapdata packages)
a vector of two coordinates (longitude, latitude) for a point we want to find nearest stations to (e.g. c(0, 0))
how many nearest stations will be returned from the given geographical coordinates
logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE
extra arguments to be provided to the graphics::plot() function (only if add_map = TRUE)
A data.frame with number of nearest station according to given point columns describing stations parameters
(e.g. ID station, distance from point in km, geographic coordinates, etc.). Each row represent a measurement,
each station which has a measurements on selected date. If add_map = TRUE additional map of downloaded data is added.
# \donttest{
nearest_stations_ogimet(country = "United Kingdom",
point = c(-2, 50),
add_map = TRUE,
no_of_stations = 50,
allow_failure = TRUE,
main = "Meteo stations in UK")
#> Wrong name of a country. Please check countries names at
#> https://ogimet.com/display_stations.php?lang=en&tipo=AND&isyn=&oaci=&nombre=&estado=&Send=Send
#> NULL
# }