update_bwb_database: Download New Files and Update Local "Database"

Description Usage Arguments

View source: R/update_bwb_database.R

Description

  1. If database/bwb/rain-ruhleben.fst exists, load a data frame from there

  2. If database/bwb/rain-ruhleben.fst does not exist, read all files in downloads/bwb/ into a data frame and save this data frame in database/rain-ruhleben.fst as well as in database/rain-ruhleben.csv

  3. Determine the days for which files are available in downloads/bwb/

  4. Determine the days for which files need to be downloaded and provide the corresponding URLs

  5. Download the files from the URLs determined in 4) into downloads/bwb/

  6. Read the downloaded files into a data frame

  7. Row-bind the data frame read in 6) with the data frame loaded in 1) or read in 2)

  8. Save the data frame resulting from 7) in database/rain-ruhleben.fst as well as in database/rain-ruhleben.csv

Usage

1
update_bwb_database(root = get_root(), start_day = "2019-06-15", dbg = TRUE)

Arguments

root

path to "root" folder below which to find subfolders "downloads" and "database"

start_day

first day of rain data to be downloaded in case that there are no downloaded files yet. Otherwise the first day is the earliest day for which data is found in the "downloads/bwb". Default: "2019-06-15"

dbg

if TRUE debug messages are shown


KWB-R/kwb.flusshygiene.app documentation built on July 18, 2021, 2:55 p.m.