Create a list of all the files (in subfolders) at the Climate Data Center (CDC)
FTP-Server from the German Weather Service (DWD, Deutscher WetterDienst) at
ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate.
The R package RCurl
must be available to do this.
If RCurl::getURL
fails, usually because bot access is
detected and denied, there will stil be an output which you can pass in a
second run via folder
to extract the remaining dirs.
You might want to wait a bit and set sleep
to a higher value in that case.
indexDWD(folder = unique(dirname(fileIndex$path)),
base = "ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate",
sleep = 0, dir = "DWDdata", quiet = FALSE, progbar = !quiet,
verbose = FALSE)
Folder to be indexed recursively, e.g. "/hourly/wind/".
DEFAULT: all folders at base
in current fileIndex
Main directory of DWD ftp server, defaulting to observed climatic records. DEFAULT: ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate
If not 0, a random number of seconds between 0 and sleep
is passed to Sys.sleep
after each read folder
to avoid getting kicked off the FTP-Server. DEFAULT: 0
Writeable directory name where to save the downloaded file.
Created if not existent. DEFAULT: "DWDdata" at current getwd()
Suppress message about directory and failed
RCurl::getURL
? DEFAULT: FALSE
Logical: present a progress bar in each level? Only works if the R package pbapply is available. DEFAULT: TRUE
Logical: write a lot of messages from RCurl::getURL
?
DEFAULT: FALSE (usually, you dont need all the curl information)
currently a vector with file paths (output may change in the future)
It's not suggested to run this for all folders, as it can take quite some time
and you may get kicked off the FTP-Server. This package contains an index
of the climatic observations at weather stations: View(rdwd:::fileIndex)
If it is out of date, please let me know!
## Needs internet connection
sol <- indexDWD(folder="/daily/solar")
head(sol)
mon <- indexDWD(folder="/monthly/kl", verbose=TRUE)
Run the code above in your browser using DataLab