Learn R Programming

solaR2 (version 0.11)

A8_readSIAR: Meteorological data from the SIAR network.

Description

Download, interpolate and transform meteorological data fromm the SIAR network.

Usage

readSIAR(Lon = 0, Lat = 0,
         inicio = paste(year(Sys.Date())-1, '01-01', sep = '-'),
         final = paste(year(Sys.Date())-1, '12-31', sep = '-'),
         tipo = 'Mensuales', n_est = 3)

Value

A Meteo object

Arguments

Lon

numeric, longitude (degrees) of the location.

Lat

numeric, latitude (degrees) of the location.

inicio

character or Date, first day of the records.

final

character or Date, last day of the records.

tipo

character, tipe of the records. To choose between Mensuales, Semanales, Diarios, Horarios.

n_est

integer, select that number of stations closest to the given point and then perform an IDW (Inverse Distance Weighting) interpolation with these data.

Author

Francisco Delgado López, Oscar Perpiñán Lamigueiro.

See Also

readG0dm, readBDd

Examples

Run this code
library("data.table")
setDTthreads(2)
library("httr2")
library("jsonlite")

SIAR = readSIAR(Lon = -3.603, Lat = 40.033,
## Aranjuez, Comunity of Madrid, Spain
                inicio = '2023-01-01',
                final = '2023-05-01',
                tipo = 'Mensuales', n_est = 3)
SIAR

Run the code above in your browser using DataLab