R package riem

M. Salmon

2016-09-09

This package allows to get weather data from ASOS stations (airports) via the awesome website of the Iowa Environment Mesonet.

Installation

Install the package with:

install.packages("riem")

Or install the development version using devtools with:

library("devtools")
install_github("ropenscilabs/riem")

Get available networks

library("riem")
riem_networks() 
#> # A tibble: 266 × 2
#>        code                      name
#>       <chr>                     <chr>
#> 1  AE__ASOS United Arab Emirates ASOS
#> 2  AF__ASOS          Afghanistan ASOS
#> 3  AG__ASOS  Antigua and Barbuda ASOS
#> 4  AI__ASOS             Anguilla ASOS
#> 5   AK_ASOS               Alaska ASOS
#> 6   AL_ASOS              Alabama ASOS
#> 7  AL__ASOS              Albania ASOS
#> 8  AM__ASOS              Armenia ASOS
#> 9  AN__ASOS Netherlands Antilles ASOS
#> 10 AO__ASOS               Angola ASOS
#> # ... with 256 more rows

Get available stations for one network

riem_stations(network = "IN__ASOS") 
#> # A tibble: 117 × 4
#>       id                   name      lon      lat
#>    <chr>                  <chr>    <dbl>    <dbl>
#> 1   VEAT       AGARTALA         91.24045 23.88698
#> 2   VIAG       AGRA (IN-AFB)    77.96089 27.15583
#> 3   VAAH       AHMADABAD        72.63465 23.07724
#> 4   VAAK       AKOLA AIRPORT    77.05863 20.69901
#> 5   VIAH       ALIGARH          78.06667 27.88333
#> 6   VIAL       ALLAHABAD (IN-AF 81.73387 25.44006
#> 7   VIAR       AMRITSAR         74.86667 31.63333
#> 8   VAOR                Arkonam 79.69120 13.07120
#> 9   VOAR                Arkonam 79.69120 13.07120
#> 10  VAAU Aurangabad Chikalthan  75.39810 19.86270
#> # ... with 107 more rows

Get measures for one station

Possible variables are (copied from here, see also the ASOS user guide)

measures <- riem_measures(station = "VOHY", date_start = "2000-01-01", date_end = "2016-04-22") 
head(measures)
#> # A tibble: 6 × 24
#>   station               valid     lon     lat  tmpf  dwpf  relh  drct
#>     <chr>              <dttm>   <dbl>   <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1    VOHY 2011-08-23 00:40:00 78.4676 17.4531  73.4  69.8 88.51     0
#> 2    VOHY 2011-08-23 01:40:00 78.4676 17.4531  73.4  69.8 88.51     0
#> 3    VOHY 2011-08-23 05:10:00 78.4676 17.4531  82.4  68.0 61.81   270
#> 4    VOHY 2011-08-23 05:40:00 78.4676 17.4531  84.2  66.2 54.80   270
#> 5    VOHY 2011-08-23 06:40:00 78.4676 17.4531  84.2  68.0 58.32   260
#> 6    VOHY 2011-08-23 07:40:00 78.4676 17.4531  84.2  66.2 54.80   250
#> # ... with 16 more variables: sknt <dbl>, p01i <dbl>, alti <dbl>,
#> #   mslp <lgl>, vsby <dbl>, gust <dbl>, skyc1 <chr>, skyc2 <chr>,
#> #   skyc3 <chr>, skyc4 <chr>, skyl1 <dbl>, skyl2 <dbl>, skyl3 <dbl>,
#> #   skyl4 <dbl>, presentwx <chr>, metar <chr>

For conversion of wind speed or temperature into other units, see this package.