All Projects → crazycapivara → owmr

crazycapivara / owmr

Licence: other
An R Interface to OpenWeatherMap

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to owmr

angular-weather-app
Angular 7 web app displays the weather report through openweathermap.org APIs
Stars: ✭ 13 (-45.83%)
Mutual labels:  weather, openweathermap
api
Community discussion and documentation for the NWS API
Stars: ✭ 168 (+600%)
Mutual labels:  weather, weather-data
homepage
Custom Start/home page (multi LIVE search) with live animated weather and news ticker - written in HTML/JS. Minimal, self-hosted, and dope.
Stars: ✭ 35 (+45.83%)
Mutual labels:  weather, weather-data
angular-openweather-app
A weather forecast app written in AngularJS
Stars: ✭ 54 (+125%)
Mutual labels:  openweathermap, weather-data
dwdweather2
Python client to access weather data from Deutscher Wetterdienst (DWD), the federal meteorological service in Germany.
Stars: ✭ 68 (+183.33%)
Mutual labels:  weather, weather-data
android-weather
View a beautiful, material design-based 10 day weather forecast
Stars: ✭ 32 (+33.33%)
Mutual labels:  weather, openweathermap
aprs-weather-submit
Manually submit weather station information to the APRS-IS network.
Stars: ✭ 17 (-29.17%)
Mutual labels:  weather, weather-data
nasapower
API Client for NASA POWER Global Meteorology, Surface Solar Energy and Climatology in R
Stars: ✭ 79 (+229.17%)
Mutual labels:  weather, weather-data
scala-weather
High-performance Scala library for looking up the weather
Stars: ✭ 45 (+87.5%)
Mutual labels:  weather, openweathermap
acuparse
Captures, stores, and displays data from an AcuRite ‎Iris/Atlas weather station and towers via an Access/smartHUB. Uploads data to Weather Underground, CWOP, Weathercloud, PWS Weather, Windy, Windguru, and OpenWeatherMap. *** MIRROR REPO | See: https://gitlab.com/acuparse/acuparse ***
Stars: ✭ 57 (+137.5%)
Mutual labels:  openweathermap, weather-data
OWM-JAPIs
Java APIs for OpenWeatherMap.org
Stars: ✭ 14 (-41.67%)
Mutual labels:  openweathermap, weather-data
react-weather-app
Weather App built with React & TypeScript
Stars: ✭ 61 (+154.17%)
Mutual labels:  weather, openweathermap
react-weather-app
An attempt to make an ultimate weather app. In ReactJS, with React hooks and context.
Stars: ✭ 39 (+62.5%)
Mutual labels:  weather, openweathermap
pluvia weather flutter
A weather app with beautiful animations, built with Flutter. Uses the OpenWeatherMap API and MapBox API.
Stars: ✭ 114 (+375%)
Mutual labels:  weather, openweathermap
epaper-clock-and-more
e-paper clock + weather + AQI + traffic delays - using Waveshare 2.7inch & 4.2inch eink displays running on Raspberry Pi
Stars: ✭ 34 (+41.67%)
Mutual labels:  weather, openweathermap
DarkSkyKit
DarkSky.net API client written in Swift.
Stars: ✭ 33 (+37.5%)
Mutual labels:  weather
Jupiter
🌞 The Swift Weather Framework
Stars: ✭ 14 (-41.67%)
Mutual labels:  weather
improver
IMPROVER is a library of algorithms for meteorological post-processing.
Stars: ✭ 76 (+216.67%)
Mutual labels:  weather
coolme
A 🌜⚽⚽👢 Discord bot, invite ➡
Stars: ✭ 13 (-45.83%)
Mutual labels:  weather
darksky-influxdb
Logs weather information from darksky.io to InfluxDB
Stars: ✭ 22 (-8.33%)
Mutual labels:  weather

An R Interface to OpenWeatherMap

CRAN_Status_Badge

owmr accesses OpenWeatherMap's API, a service providing weather data in the past, in the future and now and furthermore, serving weather map layers usable in frameworks like leaflet. In order to access its API you have to sign up for an API key at

Builds

master

Travis-CI Build Status

develop

Travis-CI Build Status

Installation

# stable
install.packages("owmr")

# unstable
devtools::install_github("crazycapivara/owmr")

# bleeding edge
devtools::install_github("crazycapivara/owmr", ref = "develop")

Introduction

See OpenWeatherMap's API documentation for optional parameters, which can be passed to all functions fetching weather data via the ... parameter in R

Setup

library(owmr)

# first of all you have to set up your api key
owmr_settings("your_api_key")

# or store it in an environment variable called OWM_API_KEY (recommended)
Sys.setenv(OWM_API_KEY = "your_api_key") # if not set globally

Usage

# get current weather data by city name
(res <- get_current("London", units = "metric") %>%
  owmr_as_tibble()) %>% names()
##  [1] "dt_txt"              "temp"                "pressure"           
##  [4] "humidity"            "temp_min"            "temp_max"           
##  [7] "weather_id"          "weather_main"        "weather_description"
## [10] "weather_icon"        "wind_speed"          "wind_deg"           
## [13] "clouds_all"          "dt_sunrise_txt"      "dt_sunset_txt"
res[, 1:6]
## # A tibble: 1 x 6
##   dt_txt               temp pressure humidity temp_min temp_max
##   <chr>               <dbl>    <dbl>    <dbl>    <dbl>    <dbl>
## 1 2018-10-28 20:50:00  4.22     1017       81        3        6
# ... by city id
(rio <- search_city_list("Rio de Janeiro")) %>%
  as.list()
## $id
## [1] 3451190
## 
## $nm
## [1] "Rio de Janeiro"
## 
## $lat
## [1] -22.90278
## 
## $lon
## [1] -43.2075
## 
## $countryCode
## [1] "BR"
get_current(rio$id, units = "metric") %>%
  owmr_as_tibble() %>% .[, 1:6]
## # A tibble: 1 x 6
##   dt_txt               temp pressure humidity temp_min temp_max
##   <chr>               <dbl>    <dbl>    <dbl>    <dbl>    <dbl>
## 1 2018-10-28 21:00:00  23.2     1014       64       23       24
# get current weather data for cities around geo point
res <- find_cities_by_geo_point(
  lat = rio$lat,
  lon = rio$lon,
  cnt = 5,
  units = "metric"
) %>% owmr_as_tibble()

idx <- c(names(res[1:6]), "name")
res[, idx]
## # A tibble: 5 x 7
##   dt_txt            temp pressure humidity temp_min temp_max name         
##   <chr>            <dbl>    <dbl>    <dbl>    <dbl>    <dbl> <chr>        
## 1 2018-10-28 21:0…  23.2     1014       64       23       24 Rio de Janei…
## 2 2018-10-28 21:0…  23.2     1014       64       23       24 São Cristóvão
## 3 2018-10-28 21:0…  23.2     1014       69       23       24 Botafogo     
## 4 2018-10-28 21:0…  23.2     1014       69       23       24 Pavão-Pavaoz…
## 5 2018-10-28 21:0…  23.2     1014       64       23       24 Vila Joaniza
# get forecast
forecast <- get_forecast("London", units = "metric") %>%
  owmr_as_tibble()

forecast[, 1:6]
## # A tibble: 40 x 6
##    dt_txt               temp pressure humidity temp_min temp_max
##    <chr>               <dbl>    <dbl>    <dbl>    <dbl>    <dbl>
##  1 2018-10-28 21:00:00  2.76    1023.       71     2.76     4.22
##  2 2018-10-29 00:00:00  1.64    1021.       90     1.64     2.73
##  3 2018-10-29 03:00:00  2.54    1019.       99     2.54     3.27
##  4 2018-10-29 06:00:00  1.64    1018.       94     1.64     2   
##  5 2018-10-29 09:00:00  4.65    1016.       84     4.65     4.65
##  6 2018-10-29 12:00:00  8.44    1013.       77     8.44     8.44
##  7 2018-10-29 15:00:00  8.47    1010.       70     8.47     8.47
##  8 2018-10-29 18:00:00  5.96    1008.       76     5.96     5.96
##  9 2018-10-29 21:00:00  3.57    1005.       87     3.57     3.57
## 10 2018-10-30 00:00:00  3.07    1003.       97     3.07     3.07
## # ... with 30 more rows
# apply funcs to some columns
funcs <- list(
  temp = round,
  wind_speed = round
)
forecast %<>% parse_columns(funcs)

# do some templating ...
("{{dt_txt}}h {{temp}}°C, {{wind_speed}} m/s" %$$%
  forecast) %>% head(10)
##  [1] "2018-10-28 21:00:00h 3°C, 5 m/s" "2018-10-29 00:00:00h 2°C, 4 m/s"
##  [3] "2018-10-29 03:00:00h 3°C, 4 m/s" "2018-10-29 06:00:00h 2°C, 4 m/s"
##  [5] "2018-10-29 09:00:00h 5°C, 3 m/s" "2018-10-29 12:00:00h 8°C, 4 m/s"
##  [7] "2018-10-29 15:00:00h 8°C, 5 m/s" "2018-10-29 18:00:00h 6°C, 4 m/s"
##  [9] "2018-10-29 21:00:00h 4°C, 4 m/s" "2018-10-30 00:00:00h 3°C, 4 m/s"

Documentation

or type

?owmr

Run tests

devtools::test()
## Loading owmr

## owmr 0.7.4
##    another crazy way to talk to OpenWeatherMap's API
##    Documentation: type ?owmr or https://crazycapivara.github.io/owmr/
##    Issues, notes and bleeding edge: https://github.com/crazycapivara/owmr/

## Testing owmr

## city list: ..
## mock httr::GET current: ....
## current weather data for multiple cities: ......
## current weather data: ........
## _DEPRECATED: W.
## mock httr::GET forecast: ......
## parse columns: ..
## render operator: ...
## tidy up data: ...
## 
## Warnings ------------------------------------------------------------------
## 1. tidy up all (@test_deprecated.R#8) - 'tidy_up_' is deprecated.
## Use 'owmr_as_tibble' instead.
## See help("Deprecated")
## 
## DONE ======================================================================
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].