rwunderground

A simple R package to get historical and forecast weather data

https://github.com/alshum/rwunderground

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 9 committers (11.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

weather weather-data weather-history weather-underground
Last synced: 9 months ago · JSON representation

Repository

A simple R package to get historical and forecast weather data

Basic Info
  • Host: GitHub
  • Owner: ALShum
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 728 KB
Statistics
  • Stars: 78
  • Watchers: 11
  • Forks: 14
  • Open Issues: 7
  • Releases: 0
Topics
weather weather-data weather-history weather-underground
Created about 11 years ago · Last pushed about 8 years ago
Metadata Files
Readme

README.md

Build Status

Weather Underground R API

This is an R interface to weather underground's API.
In order to use this library please register for an API key. The free-tier should be sufficient if you aren't calling the API more than a 500 times per day. Please note that the free tier also limits requests to 10 per minute. If you are grabbing weather for a large date range using history_range then by default limit = 10 will limit the calls to a maximum of 10 per minute. This package has functions that follow the online api.

Install and Setup

This package is officially on CRAN; install using install.packages("rwunderground").

To install the latest version please use devtools. If you don't have devtools install using install.packages("devtools"). Afterwards install rwunderground using devtools: devtools::install_github("ALShum/rwunderground").

Once you have your API key as indicated above you can set the key in R using: rwunderground::set_api_key("YOUR KEY"). You only have to do this once per R session. Alternatively you can save the key in your local .Renviron file by adding the line WUNDERGROUNDID = 'your key here'.

Locations

For any of the API functions you must first specify a location -- the first argument of all the API functions is a location. Locations can be specified by the airport code, zip code, personal weather station ID or simply by specifying state and city (if in US) or country and city (if outside US). The set_location function will validate locations and format things correctly or you can use a (correctly formatted) string.

Locations by country/state/city

Setting the location to Honolulu, HI: set_location(territory = "Hawaii", city = "Honolulu").

Setting the location to Mombasa, Kenya: set_location(territory = "Kenya", city = "Mombasa").

Setting the location to San Diego, California: set_location(territory = "California", city = "San Diego")

As alluded above, set_location will attempt to validate and make sure the locations are formatted correctly. If you have trust in your own geography and spelling skills then you can simple replace the set_location function with a string formatted as "territory/city" such as: "Hawaii/Honolulu" or "Kenya/Mombasa".

Locations by airport

Locations can be specified by airport codes.

Setting the location to Seattle/Tacoma airport: set_location(airport_code = "SEA")

If you don't know the airport code you can look them up using lookup_airport: lookup_airport("seattle"). This will lookup IATA and ICAO airport codes.

Locations by zip code

set_location(zip_code = "96813")

Locations by lat/long

set_location(lat_long = "50,-100") Note that coordinates should be comma separated.

Other

If no argument is provided to set_location then by default the nearest weather station will be used. You can also specify location based on lat/lon or personal weather station ID.

Package Functionality Summary

Note: by default units are in imperial (temperature is F, windspeed in MPH etc.) -- sorry rest of the world! To use metric, you can set use_metric = TRUE for many of the functions.

Main Functions

  • history, history_daily, history_range: weather history functions
  • forecast3day, forecast10day: daily summary forecasts
  • hourly, hourly10day: hourly forecasts
  • planner: Historical weather summary for date range

Additional API Functions

  • alerts: Weather alerts
  • almanac: historical weather records for current date
  • astronomy: sunrise/sunset and moonrise/moonset
  • conditions: current weather conditions
  • geolookup: weather station lookup
  • current_hurricane: current hurricane information
  • satellite: satellite image URLs
  • tide, rawtide: tide forecasts
  • webcam: live webcam image URLS
  • yesterday: historical weather information for yesterday

Supporting Functions

  • lookup_airport: Look up airport codes if you plan on looking up weather data using airport locations.

History

After a location is set, weather history is available using history.

To request the weather for Honolulu, HI on January 31, 2015:

history(set_location(territory = "Hawaii", city = "Honolulu"), date = 20150131)

Note that dates must be in YYYYMMDD.

Forecast

Forecast weather data is available using forecast3day and forecast10day. Hourly forecasts are also available using hourly and hourly10day. The forecast functions do a daily summary forecast and the hourly functions do hourly forecasts.

To get the 10 day forecast and 10 day hourly forecast for Honolulu, Hawaii:

forecast10day(set_location(territory = "Hawaii", city = "Honolulu")) hourly10day(set_location(territory = "Hawaii", city = "Honolulu"))

Planner

Note that dates for this must be in MMDD form: planner(set_location(territory = "IR", city = "Tehran"), start_date = "0101", end_date = "0131")

Tide information

Tide high/low forecasts are available using tide and hourly tide forecasts available using rawtide.

To get the high/low tide information for Honolulu, Hawaii:

tide(set_location(territory = "Hawaii", city = "Honolulu")) rawtide(set_location(territory = "Hawaii", city = "Honolulu"))

Weather Alerts

Weather alerts are available as plain text.

Weather Alerts for Honolulu, Hawaii: alerts(set_location(territory = "Hawaii", city = "Honolulu"))

Owner

  • Name: Alex
  • Login: ALShum
  • Kind: user

https://twitter.com/NotAlexShum

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 144
  • Total Committers: 9
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.361
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
ALShum a****6@g****m 92
Alex a****m@i****u 17
Eric Hare e****e@g****m 13
Craig Mohn c****s@g****m 11
Kirill Müller k****r@m****g 5
CatherineCao2016 c****4@g****m 2
Joe Shannon j****n@o****m 2
Steven Pav s****f@g****m 1
ALShum M****A@M****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 31
  • Total pull requests: 14
  • Average time to close issues: 2 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 19
  • Total pull request authors: 7
  • Average comments per issue: 1.77
  • Average comments per pull request: 0.79
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ALShum (9)
  • CraigMohn (3)
  • ghost (2)
  • ChristinaHolmes (2)
  • pssguy (1)
  • einabadi-sh (1)
  • AkshayKapila (1)
  • neilfws (1)
  • vectoranalytica (1)
  • LABurns (1)
  • jminot (1)
  • batpigandme (1)
  • shabbychef (1)
  • philiporlando (1)
  • Tolsi (1)
Pull Request Authors
  • jpshanno (3)
  • CraigMohn (3)
  • krlmlr (2)
  • ALShum (2)
  • CatherineCao2016 (2)
  • shabbychef (1)
  • erichare (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 246 last-month
  • Total docker downloads: 42,005
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: rwunderground

R Interface to Weather Underground API

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 246 Last month
  • Docker Downloads: 42,005
Rankings
Forks count: 5.0%
Stargazers count: 5.0%
Average: 24.0%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 44.5%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • countrycode * imports
  • dplyr * imports
  • httr * imports
  • lubridate * imports
  • tibble * imports