Learn R Programming

meteoland (version 2.0.1)

downloadAEMETcurrentday: Download data from AEMET

Description

[Deprecated]

Download data from the Spanish National Meterology Agency (AEMET)

Usage

downloadAEMETcurrentday(api, daily = TRUE, verbose = TRUE)

downloadAEMEThistorical( api, dates, station_id = NULL, export = FALSE, exportDir = getwd(), exportFormat = "meteoland/txt", metadataFile = "MP.txt", verbose = TRUE )

downloadAEMETstationlist(api)

Value

Function downloadAEMETstationlist returns a SpatialPointsDataFrame 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 is available 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 solely returns a SpatialPointsDataFrame 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 object with observations aggregated at the daily scale if else.

Arguments

api

String with the AEMET API key (see https://opendata.aemet.es/).

daily

Boolean flag. Are data to be returned at a daily or hourly scale?

verbose

Boolean flag to print process information.

dates

An object of class Date.

station_id

A string vector containing station ids (the list of stations for which historical climatic series are available is given by downloadAEMETstationlist).

export

If export = FALSE the downloaded data is stored in memory. Otherwise the result is written on the disk (using the format specified in exportFormat).

exportDir

Output directory for downloaded meteorology.

exportFormat

Format of meteorological data. Current accepted formats are "castanea" and "meteoland".

metadataFile

The name of the file that will store the meta data describing all written files.

Functions

  • downloadAEMEThistorical(): [Deprecated]

  • downloadAEMETstationlist(): [Deprecated]

Author

Antoine Cabon, CTFC

Miquel De Cáceres Ainsa, CREAF

Details

API key needs to be acquired from AEMET (https://opendata.aemet.es/)

References

AEMET should be acknowledged as author of information when using this data.

See Also

SpatialPointsMeteorology-class