read_smn: Reads a file from the SwissMetNet of MeteoSwiss

View source: R/read-smn.R

read_smnR Documentation

Reads a file from the SwissMetNet of MeteoSwiss

Description

SwissMetNet, the automatic monitoring network of MeteoSwiss the Federal Office for Meteorology and Climatology, comprises about 160 automatic monitoring stations. These stations deliver a multitude of current data on the weather and climate in Switzerland every ten minutes. The monitoring network is supplemented by automatic precipitation stations.

This Function autodetects the delimeter and tries to find the interval. In Addition the time information in the files is utc and end time. The time is converted to start time and the time zone defined trough the argument tz. The argument time_shift provides a way to manuelly shift the time series. In this case no automatically shifting is applied. The provided values is directly added to information in the file.

Usage

read_smn(
  fn,
  tz = "Etc/GMT-1",
  encoding = "UTF-8",
  time_shift = NULL,
  time_format = NULL,
  interval = NULL,
  na.rm = TRUE
)

Arguments

fn

path to input file

tz

of the output data. Default "Etc/GMT-1"

encoding

encoding of the data file. Default = "UTF-8"

time_shift

a lubridate period to add to the time. Default NULL

time_format

optional time_format. Use if auto detect fails. Default NULL

interval

optional interval of the data. Use if auto detect fails. Default NULL. If used it is necessary to define time_shift manuelly. lubridate::period(0) can be used for no shifting

na.rm

remove na values. Default TRUE

Value

tibble in rOstluft long format structure

Examples

input <- system.file("extdata", "smn.txt", package = "rOstluft.data", mustWork = TRUE)
read_smn(input)


Ostluft/rOstluft documentation built on Feb. 6, 2024, 1:26 a.m.