Description Usage Arguments Functions Source Examples
View source: R/download_rebecka.R
These functions download station data from the REBECKA stations using an API to the pessl database.
The function rg_rebecka_ids
can be used to request the available station ids which are in turn
used in the function rg_rebecka_get
to download data for a desired time period. Data from the
stations is available from 2017 - 2020 in 10 minute (raw), hourly and daily resolution. Downloading
requires a public and private Key. The functions internally use the package reticulate
to
source a python script and connect to the API. The python script was written in python 2.7, it is
not guaranteed to work with newer python versions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | rg_rebecka_get(
station_code,
publicKey = "056c0e506344aff17f6b60237d9dabcb87f1e8b4",
privateKey,
datestart = Sys.Date() - 1,
dateend = Sys.Date(),
url = "https://api.fieldclimate.com/v1",
time_res = "raw",
progress = T
)
rg_rebecka_codes(
publicKey = "056c0e506344aff17f6b60237d9dabcb87f1e8b4",
privateKey,
url = "https://api.fieldclimate.com/v1"
)
|
station_code |
character, IDs of the station(s) to download |
publicKey |
string, public KEY used for API authentication |
privateKey |
string, private KEY used for API authentication |
datestart |
date, starting date for download |
dateend |
date, ending date for download |
url |
string, url for the API |
time_res |
string, time resolution of the downloaded data, one of 'raw', 'hourly' or 'daily'. |
rg_rebecka_codes
: Request station ids for the REBECKA stations
https://api.fieldclimate.com/v1/docs/
1 2 3 4 5 | Get a vector of available station ids
ids <- rg_rebecka_ids(publicKey = XXX, privateKey = XXX)
download data for the first station at daily resolution for one year
data <- rg_rebecka_get(station_code = ids[[1]], publicKey = XXX, privateKey = XXX, datestart = as.Date('20180101', format = '%Y%m%d'), dateend = as.Date('20180105', format = '%Y%m%d'), time_res = 'daily')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.