Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.19 KB

README.md

File metadata and controls

32 lines (20 loc) · 1.19 KB

simplefmi

R build status codecov

An R package for downloading weather data from the FMI API in a tidy format for personal use. Inspired by the fmi-package, but with a lot less functionality.

Installation

devtools::install_github("paasim/simplefmi")

Usage

library(simplefmi)
library(lubridate) # for date-variables

yesterday <- today() - days(1)
yesterday_0 <- ymd_hms(stringr::str_c(yesterday, " 00:00:00"))
yesterday_23 <- ymd_hms(stringr::str_c(yesterday, " 23:00:00"))

# get yesterday's hourly rain and temperature data from kaisaniemi
weather <- fmi_weather(yesterday_0, yesterday_23, hourly = TRUE)

# get yesterday's air quality index for mannerheimintie
airquality <- fmi_airquality(yesterday_0, yesterday_23)

# get yesterday's direct and diffuse radiation
radiatio <- fmi_radiation(yesterday_0, yesterday_23)