parse_cosmo_2e | R Documentation |
Parse COSMO-2E Point Forecasts from MeteoSwiss
parse_cosmo_2e(p = NULL, remote = FALSE, stn.list = NULL)
p |
File path or URL |
remote |
Load from remote (URL) |
stn.list |
Character vector of station identifier (e. g. "SMA" or c("BAS", "ABO")) |
data table
M. Saenger
require(data.table)
require(ggplot2)
# Download
dt <- parse_cosmo_2e(remote = TRUE, stn.list = c("SMA"))
# Quantiles
q <- c(.1, .9)
dt.q <- dt[, as.list(quantile(value, q, na.rm = TRUE)), .(stn, para, time)]
# Station information (including grid altitude)
attr(dt, "meta")
# Plot temperature forcast (10-90% as ribbon, members as lines)
ggplot(dt[para == "tt"], aes(time, value)) +
geom_ribbon(aes(y = NULL, ymin = `10%`, ymax = `90%`),
data = dt.q[para == "tt"], fill = "lightblue") +
geom_path(aes( group = member), size = .1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.