Learn R Programming

climate (version 1.2.1)

nearest_stations_imgw: List of nearby meteorological or hydrological IMGW-PIB stations in Poland

Description

Returns a data frame of meteorological or hydrological stations with their coordinates in particular year. The returned object is valid only for a given year and type of stations (e.g. "synop", "climate" or "precip"). If add_map = TRUE additional map of downloaded data is added.

Usage

nearest_stations_imgw(
  type = "meteo",
  rank = "synop",
  year = 2018,
  add_map = TRUE,
  point = NULL,
  no_of_stations = 50,
  allow_failure = TRUE,
  ...
)

Value

A data.frame with a list of nearest stations. Each row represents metadata for station which collected measurements in a given year. Particular columns contain stations metadata (e.g. station ID, geographical coordinates, official name, distance in kilometers from a given coordinates).

Arguments

type

data name; "meteo" (default), "hydro"

rank

rank of the stations: "synop" (default), "climate", or "precip"; Only valid if type = "meteo"

year

select year for searching nearest station

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(15, 53)); If not provided calculated as a mean longitude and latitude for the entire dataset

no_of_stations

how many nearest stations will be returned from the given geographical coordinates. 50 used by default

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)

Examples

Run this code
# \donttest{
  df =  nearest_stations_imgw(type = "meteo", 
  rank = "synop",
  year = 2018,
  point = c(17, 52),
  add_map = TRUE, 
  no_of_stations = 4)
# }

Run the code above in your browser using DataLab