if (FALSE) { # interactive()
library(keyring)
library(meteospain)
## AEMET examples ---------------------------------------------------------
# setting the key (a prompt will appear in console to supply the API key)
# keyring::key_set(service = 'aemet')
# Options for the last 24h data
current_opts <- aemet_options(
resolution = 'current_day',
api = keyring::key_get('aemet')
)
# Options for daily data for January, 1990
daily_opts <- aemet_options(
resolution = 'daily',
start_date = as.Date('1990-01-01'),
end_date = as.Date('1990-01-15'),
api = keyring::key_get('aemet')
)
}
if (FALSE) { # interactive()
## MeteoCat examples -----------------------------------------------------------
# setting the key (a prompt will appear in console to supply the API key)
# keyring::key_set(service = 'meteocat')
# create the options
query_options <- meteocat_options(
resolution = 'hourly',
start_date = as.Date('2020-12-31'),
api = keyring::key_get('meteocat')
)
}
## Meteoclimatic examples -------------------------------------------------
current_opts <- meteoclimatic_options()
# same as before, but more verbose
current_opts <- meteoclimatic_options(resolution = 'current_day', stations = 'ES')
## MeteoGalicia examples --------------------------------------------------
# Options for the last measured data
instant_opts <- meteogalicia_options(resolution = 'instant')
# Options for the last 24h data
current_opts <- meteogalicia_options(resolution = 'current_day')
# same, with stations
current_opts <- meteogalicia_options('current_day', stations = c('10045', '10046'))
# Options for daily data for January, 2000
daily_opts <- meteogalicia_options(
resolution = 'daily',
start_date = as.Date('2000-01-01'),
end_date = as.Date('2000-01-31')
)
# Options for monthly data for year 2000
monthly_opts <- meteogalicia_options(
resolution = 'monthly',
start_date = as.Date('2000-01-01'),
end_date = as.Date('2000-12-31')
)
if (FALSE) { # interactive()
library(keyring)
library(meteospain)
## RIA examples ---------------------------------------------------------
# Options for daily data for April, 2020
daily_opts <- ria_options(
resolution = 'daily',
start_date = as.Date('2020-04-01'),
end_date = as.Date('2020-04-30')
)
}
Run the code above in your browser using DataLab