GetSMNData {metR} | R Documentation |
Get Meteorological data
Description
Downloads minimum and maximum temperature station data from Argentina's National Weather Service's public access. Data availability is not guaranteed so you are encouraged to check it on the website.
Usage
GetSMNData(
date,
type = c("hourly", "daily", "radiation"),
bar = FALSE,
cache = TRUE,
file.dir = tempdir()
)
Arguments
date |
date vector of dates to fetch data |
type |
type of data to retrieve |
bar |
logical object indicating whether to show a progress bar |
cache |
logical indicating if the results should be saved on disk |
file.dir |
optional directory where to save and/or retrieve data |
Value
For type = "hourly"
, a data.frame with observations of
- date
date
- t
temperature in degrees celsius
- rh
relative humidity in %
- slp
sea level pressure in hPa
- dir
wind direction in clockwise degrees from 6 o'clock
- V
wind magnitude in m/s
- station
station name
For type = "daily"
, a data.frame with observations of
- date
date
- tmax
maximum daily temperature in degrees celsius
- tmin
minimum daily temperature in degrees celsius
- station
station name
For type = "radiation"
, a data.frame with observations of
- date
date
- global
global radiation in W/m^2
- diffuse
diffuse radiation in W/m^2
- station
station name
Source
https://ssl.smn.gob.ar/dpd/pron5d-calendario.php
Examples
## Not run:
dates <- seq.Date(lubridate::today() - 30, lubridate::today(), by = "1 day")
data <- GetSMNData(dates, type = "daily", bar = TRUE)
library(ggplot2)
ggplot(subset(data, station == "BASE BELGRANO II"),
aes(date, (tmax + tmin)/2)) +
geom_line()
## End(Not run)