get_radolan_urls_bucket: Get URLs to Binary Radolan Files From Flusshygiene's Amazon...

Description Usage Arguments Value Examples

View source: R/get_radolan_urls_bucket.R

Description

This function requires two environment variables to be set: "ENDPOINT_PROD": Endpoint to the service that returns URLs to Radolan files, "TOKEN_PROD": token that is required to access the endpoint. Use usethis::edit_r_environ() to open the .Renviron file in your home directory and add two lines "ENDPOINT_PROD=..." and "TOKEN_PROD=..." where ... is replaced with the corresponding values.

Usage

1
2
3
4
5
6
get_radolan_urls_bucket(
  from = format(Sys.Date() - 1, "%Y%m%d"),
  to = from,
  time = "",
  bathing_season_only = FALSE
)

Arguments

from

first day considered in format yyyymmdd, e.g. "20190625". Default: string representing "yesterday". If only the year and the month or only the year are given, the first day of the month and the first day of the year, respectively, are assumed.

to

last day considered in format yyyymmdd, e.g. "20190625". Default: same day as given in from. If only the year and the month or only the year are given, the last day of the month and the last day of the year, respectively, are assumed.

time

considered, given in format HHMM, e.g. "1050". Default: "", i.e. URLs are not filtered by time

bathing_season_only

= FALSE if TRUE (the default is FALSE), only URLs related to days between May 1 and September 30 are returned

Value

vector of character containing the URLs to the radolan files. The date and time to which the data in the files relate are encoded in the names of the returned vector elements in the format "yyyymmddHHMM".

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Get URLs to available files for 2019-06-25, 10:50
urls <- get_radolan_urls_bucket(from = "20190625", time = "1050")

# Read the first file (there should be only one such file!)
raster_rain <- kwb.dwd::read_binary_radolan_file(urls[1])

## End(Not run)

KWB-R/fhpredict documentation built on Nov. 1, 2020, 5:58 a.m.