| meteo_ogimet | R Documentation |
Unified entry point for downloading hourly or daily meteorological data from Ogimet. Two backends are supported:
meteo_ogimet(
interval = "hourly",
date = c(Sys.Date() - 30, Sys.Date()),
station = NULL,
country_name = NULL,
source = NULL,
...
)
interval |
|
date |
Length-2 character or Date vector giving the start and end of
the requested period, e.g. |
station |
WMO ID(s) of the station(s) to download. Character or numeric
vector. Not required when |
country_name |
Optional character string. When provided, the SYNOP path
downloads all Ogimet stations for the named country in a single request
(e.g. |
source |
Character. Backend to use: |
... |
Optional named arguments:
|
"synop" (default for hourly): Downloads raw SYNOP messages from the
Ogimet getsynop endpoint and decodes them with synop_parser(). Supports
station mode (one or more WMO IDs) and/or country mode (country_name).
A default output columns are described in the synop output section below, but
can be enhanced optionally with simplified = FALSE or return_list = TRUE
to include more of decoded SYNOP fields.
"html" (default for daily): Scrapes pre-formatted summary tables
from the Ogimet using HTML parsing. Supports station mode only (one or more WMO IDs).
Output columns are described in the html output section below.
synop output (source = "synop", simplified = TRUE or return_list = TRUE $data):
A data.frame with one row per decoded SYNOP observation and approx. 20 columns:
date (POSIXct UTC), station, t2m, dpt2m, rel_hum, tmax,
tmin, wd, ws, gust, press, slp, press_tend, precip,
Nt, Nh, N_base, insol, visibility, snow.
synop output (source = "synop", simplified = FALSE):
A data.frame with 30+ columns from synop_parser(), prefixed by station_id
and Date.
html output (source = "html", interval = "hourly"):
A data.frame with columns: station_ID, optionally Lon/Lat,
Date, TC, TdC, TmaxC, TminC, ddd, ffkmh, Gustkmh,
P0hPa, PseahPa, PTnd, Nt, Nh, HKm, InsoD1, Viskm,
Snowcm, and (when precip_split = TRUE) pr6, pr12, pr24.
html output (source = "html", interval = "daily"):
A data.frame with columns: station_ID, optionally Lon/Lat,
Date, TemperatureCAvg, TemperatureCMax, TemperatureCMin,
TdAvgC, HrAvg, WindkmhDir, WindkmhInt, WindkmhGust,
PresslevHp, PreselevHp, Precmm, SunD1h, SnowDepcm,
TotClOct, lowClOct, VisKm.
Returns NULL invisibly on failure when allow_failure = TRUE.
# Hourly SYNOP data for Poznan-Lawica (default source = "synop")
poznan_h = meteo_ogimet(interval = "hourly",
station = 12330,
date = c("2009-12-01", "2009-12-04"))
# Daily HTML summaries for New York - La Guardia (default source = "html")
new_york = meteo_ogimet(interval = "daily", station = 72503)
# Hourly with full parser output as a list
poznan_list = meteo_ogimet(interval = "hourly",
station = 12330,
date = c("2009-12-01", "2009-12-04"),
return_list = TRUE)
head(poznan_list$data) # simplified
head(poznan_list$full) # all parser columns
# Country mode: all Polish stations for one day
germany = meteo_ogimet(interval = "hourly",
country_name = "Germany",
date = c("2009-12-15", "2009-12-15"))
# Force SYNOP backend for daily data
poznan_d = meteo_ogimet(interval = "daily",
station = 12330,
date = c("2009-12-01", "2009-12-04"),
source = "synop")
# Force HTML backend for hourly data
poznan_h2 = meteo_ogimet(interval = "hourly",
station = 12330,
date = c("2019-06-01", "2019-06-08"),
source = "html")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.