Package 'msdata'

Title: Downloading MeteoSwiss Meteorological Observations via the Geoportal des Bundes (Swiss Federal Government Open Data Portal)
Description: Small package built on top of the `swissgeo.core` package to easily retrieve meteorological observations from automated weather stations of the Swiss meteorological service (MeteoSchweiz).
Authors: Reto Stauffer [aut, cre] (ORCID: <https://orcid.org/0000-0002-3798-5507>)
Maintainer: Reto Stauffer <[email protected]>
License: GPL-2
Version: 0.1-0
Built: 2026-09-18 11:14:44 UTC
Source: http://codeberg.org/retostauffer/msdata

Help Index


MeteoSwiss Datasets

Description

MeteoSwiss Datasets

Usage

ms_datasets(...)

Arguments

...

forwarded to sg_collections, currently raw (logical) and verbose (logical).

Author(s)

Reto


MeteoSwiss Datasets

Description

MeteoSwiss Datasets

Usage

ms_metadata(id, language = "en", cachedir = NULL, ndays = 2, ...)

## S3 method for class 'ms_metadata'
plot(x, what = "station_height_masl", labels = "station_abbr", ...)

Arguments

id

character, id of the dataset (collection).

language

character, defaults to \"en\".

cachedir

NULL or path to a directory. If set, the metadata will be cached for up to n days (see argument ndays). Note that this means that the language can't be changed.

ndays

numeric, number of days to re-use cached file if cahcedir is set.

...

forwarded to sg_download_assets or the default plot() function.

x

object of class ms_metadata as returned by ms_metadata().

what

character, name of variable to be plotted.

labels

NULL or character, name of the variable used to add labels to the plot.

Value

A list with three elements is returned containing data inventory information (⁠$datainventory⁠; tibble data frame), a list of all parameters with description (⁠$datainventory⁠; tibble data frame), as well as a simple feature data frame with all available stations (⁠$stations⁠).

Author(s)

Reto


Downloading Station Data

Description

Downloading Station Data

Usage

ms_stationdata(
  id,
  stations,
  resolution = c("h", "t", "d", "m", "y"),
  parameters = NULL,
  start = NULL,
  end = NULL,
  cachedir = NULL,
  verbose = FALSE,
  language = "en"
)

## S3 method for class 'ms_stationdata'
print(x, ...)

## S3 method for class 'ms_stationdata'
head(x, n = 6L, ...)

## S3 method for class 'ms_stationdata'
tail(x, n = 6L, ...)

## S3 method for class 'ms_stationdata'
plot(x, ...)

Arguments

id

the identifier of the dataset (collection).

stations

vector with station abbreviations (station identifiers). Not case sensitive.

resolution

character, temporal resolution (h = hourly, t = 10 minutes, d = daily, m = monthly, y = annual/yearly).

parameters

if NULL all paramters found will be returned. Can be a character vector with existing parameter shortnames.

start

NULL or the start date/time.

end

NULL or end date/time. If both start and end are NULL the most recent observations are returned.

cachedir

NULL or path to a directory to cache data.

verbose

logical, defaults to FALSE.

language

forwarded to ms_metadata().

x

object of class ms_stationdata.

...

forwarded to plot.zoo().

n

integer, number of observations to be returned.

Value

On success a zoo object or a list of zoo objects is returned (if multiple stations are processed at the same time).

Author(s)

Reto