extract.content.climate: Unzips and extracts the content of DWD source files for a...

Description Usage Arguments Details Author(s) Examples

View source: R/import.R

Description

Reads in the content and the metadata of both the recent and historical files corresponding to a single station, combines its data, and converts it into a format R can handle.

Usage

1
2
3
extract.content.climate(station.id, files.list, download.folder.recent,
  download.folder.historical, time.series.format = c("xts",
  "data.frame"))

Arguments

station.id

String specifying a station.

files.list

Named list of character vectors containing absolute paths pointing towards the .zip files downloaded from the DWD FTP server. The names correspond to recent and historical.

download.folder.recent

Folder, which will contain the extracted recent archive.

download.folder.historical

Folder, which will contain the extracted historical archive.

time.series.format

Format of the extracted time series. They can either be of type data.frame and contain two columns, "date" and "value", or a time series provided by the xts package. Default = "xts".

Details

The station is specified by its station.id. The extraction will take place in either download.folder.recent or download.folder.historical. Before extraction all its content will be removed.

Author(s)

Philipp Mueller

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## The \pkg{dwd2r} provides some mock data so its internal
  ## functions can be tested and developed without downloading
  ## any content from the DWD server. At the package's root
  ## directory call this function in the following way.
  dwd2r:::extract.content.climate( "03987",
    list( historical = file.path(
            system.file( "inst", package = "dwd2r" ), "res",
            "produkt_03987_potsdam_historical_mock.zip" ),
          recent = file.path(
            system.file( "inst", package = "dwd2r" ), "res",
            "produkt_potsdam_recent_03987_mock.zip" ) ),
          "tmpRecent", "tmpHistorical", "xts" )

theGreatWhiteShark/dwd2r documentation built on May 22, 2019, 2:26 p.m.