parse_cosmo_2e: Parse COSMO-2E Point Forecasts from MeteoSwiss

parse_cosmo_2eR Documentation

Parse COSMO-2E Point Forecasts from MeteoSwiss

Description

Parse COSMO-2E Point Forecasts from MeteoSwiss

Usage

parse_cosmo_2e(p = NULL, remote = FALSE, stn.list = NULL)

Arguments

p

File path or URL

remote

Load from remote (URL)

stn.list

Character vector of station identifier (e. g. "SMA" or c("BAS", "ABO"))

Value

data table

Author(s)

M. Saenger

Examples


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)

m-saenger/wxSwiss documentation built on Nov. 15, 2024, 3:02 a.m.