5.1 Quering weather data with stationaRy.

# https://github.com/hadley/stationaRy

library(stationaRy) #install.packages("stationaRy")
library(magrittr)
library(dplyr)

get_isd_stations(lower_lat = 51.1297700,
                 upper_lat = 52.2297700,
                 lower_lon = 20.0117800,
                 upper_lon = 21.1117800) %>%
  map_isd_stations()

# OKECIE      PL       52.166 20.967

high_temps_at_okecie_stn <- 
  get_isd_stations() %>%
  select_isd_station(name = "okecie") %>%
  get_isd_station_data(startyear = 2014, endyear = 2015) %>%
  select(time, wd, ws, temp) %>% 
  filter(temp > 30) %>%
  mutate(temp_f = (temp * (9/5)) + 32)

library(stationaRy)
library(magrittr)
library(dplyr)

rainfall_6h_june2015 <- 
  get_isd_stations(startyear = 1970, endyear = 2015,
                   lower_lat = 49, upper_lat = 53,
                   lower_lon = 19, upper_lon = 21) %>%
  select_isd_station(name = "OKECIE") %>%
  get_isd_station_data(startyear = 2015,
                       endyear = 2015,
                       select_additional_data = "AA1") %>%
  filter(month == 6, aa1_1 == 6) %>% 
  select(aa1_2) %>% sum()

results matching ""

    No results matching ""