Returns 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.

nearest_stations_ogimet(
  country = "United Kingdom",
  date = Sys.Date(),
  add_map = FALSE,
  point = c(2, 50),
  no_of_stations = 10,
  allow_failure = TRUE,
  ...
)

Arguments

country

country name; for more than two words they need to be seperated with a plus character (e.g., "United+Kingdom"). It is possible to provide more than one country combined into a vector

date

optionally, a day when measurements were done in all available locations; current Sys.Date used by default

add_map

logical - whether to draw a map for a returned data frame (requires maps/mapdata packages)

point

a vector of two coordinates (longitude, latitude) for a point we want to find nearest stations to (e.g. c(0, 0))

no_of_stations

how many nearest stations will be returned from the given geographical coordinates

allow_failure

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)

Value

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.

Examples

# \donttest{
  nearest_stations_ogimet(country = "Uniced Kingdom", 
                          point = c(-2, 50),
                          add_map = TRUE, 
                          no_of_stations = 0, 
                          allow_failure = TRUE,
                          main = "Meteo stations in UK")
#> [1] "http://ogimet.com/cgi-bin/gsynres?lang=en&state=Uniced+Kingdom&osum=no&fmt=html&ord=REV&ano=2024&mes=05&day=10&hora=06&ndays=1&Send=send"
#> /tmp/RtmpAZrh4Q/file18ea1a3a9400
#> Problems with downloading data. Run function with argument allow_failure = FALSE to see more details
# }