Description Usage Arguments Details Value Note Author(s) References See Also
Download data from the Spanish National Meterology Agency (AEMET)
1 2 3 4 5 | downloadAEMEThistoricalstationlist(api)
downloadAEMEThistorical(api, dates, station_id, export = FALSE, exportDir = getwd(),
exportFormat = "meteoland/txt", metadatafile = "MP.txt",
verbose = TRUE)
downloadAEMETcurrentday(api, daily = TRUE, verbose = TRUE)
|
api |
String with the AEMET API key (see https://opendata.aemet.es/). |
dates |
An object of class |
station_id |
A string vector containing station ids (the list of stations for which historical climatic series are available is given by |
export |
If |
exportDir |
Output directory for downloaded meteorology. |
exportFormat |
Format of meteorological data. Current accepted formats are |
metadatafile |
The name of the file that will store the meta data describing all written files. |
verbose |
Boolean flag to print process information. |
daily |
Boolean flag. Are data to be returned at a daily or hourly scale? |
API key needs to be acquired from AEMET (https://opendata.aemet.es/)
Function downloadAEMEThistoricalstationlist
returns a SpatialPointsDataFrame-class
object containing the list of AEMET weather stations for which historical climatic series are available and can be retrieved using downloadAEMEThistorical
.
Function downloadAEMEThistorical
downloads data for the specified AEMET stations and dates. Data are availables for dates up to 4 days before current date. If export = FALSE
, function downloadAEMEThistorical
returns a SpatialPointsMeteorology-class
object with the downloaded meteorology for each station (point). Otherwise the function writes on the disk at the location specified by exportDir
and solelely returns a SpatialPointsDataFrame-class
object containing the files metadata.
Function downloadAEMETcurrentday
downloads recent weather (the last 24h) from all currently available stations and returns data frame if daily = FALSE
or a SpatialPointsDataFrame-class
object with observations aggregated at the daily scale if else.
The list of stations available in downloadAEMETcurrentday
(current observations) is different from the list given by downloadAEMEThistoricalstationlist
and available in downloadAEMEThistorical
(stations with historical climate series).
Antoine Cabon, CTFC
Miquel De Cáceres Ainsa, CTFC
AEMET should be acknowledged as author of information when using this data.
SpatialPointsMeteorology-class
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.