fmi_weather: fmi_weather

View source: R/fmi_download.R

fmi_weatherR Documentation

fmi_weather

Description

Download data from the fmi weather API. If the request is larger than the api allows, it is split into multiple parts. If this results to more than 30 queries, a warning message is printed.

Usage

fmi_weather(
  start,
  end = start,
  station_id = "100971",
  params = ifelse(hourly, "t2m,r_1h", "tday,rrday"),
  hourly = FALSE,
  simplify_names = TRUE,
  verbose = FALSE,
  fmi_apikey = NA_character_
)

Arguments

start

Start time as a POSIXt-object obtained with e.g. lubridate::as_datetime().

end

End time as a POSIXt-object. Defaults to start.

station_id

The weather station id. Defaults to 100971. (Kaisaniemi weather station). A list of the available stations can be downloaded with the get_stations()-function.

params

Query parameters, a comma separated string, such as "tday,rrday". For more options, see Details.

hourly

If TRUE, hourly data is downloaded. Otherwise the daily data is downloaded.

simplify_names

If TRUE, variable names are simplified (eg. t2m is converted to temp).

verbose

If TRUE, prints the progress. Defaults to FALSE.

fmi_apikey

An optional fmi-apikey. See http://en.ilmatieteenlaitos.fi/open-data-manual.

Details

The available variables are listed below, more information can be found from https://en.ilmatieteenlaitos.fi/open-data-manual.

The following variables are available for hourly data:

  • t2m: temperature

  • ws_10min: wind speed

  • wg_10min: gust speed

  • wd_10min: wind direction

  • n_man: cloud cover

  • rh: relative humidity

  • td: dew point

  • r_1h: rain amount

  • ri_10min: rain intensity

  • snow_aws: snow depth

  • p_sea: air pressure

  • vis: visibility

  • wawa: weather code

The following variables are available for daily data:

  • rrday: rain

  • tday: temperature

  • snow: snow depth

  • tmin: temperature (min)

  • tmax: temperature (max)

  • tg_pt12h_min: minmum ground temperature

Value

A tibble with date (& time if hourly data is requested) in the first column and the variables specified in params in the other columns.


paasim/simplefmi documentation built on Aug. 4, 2023, 10:30 p.m.