Title: | R Interface to Weather Underground API |
---|---|
Description: | Tools for getting historical weather information and forecasts from wunderground.com. Historical weather and forecast data includes, but is not limited to, temperature, humidity, windchill, wind speed, dew point, heat index. Additionally, the weather underground weather API also includes information on sunrise/sunset, tidal conditions, satellite/webcam imagery, weather alerts, hurricane alerts and historical high/low temperatures. |
Authors: | Alex Shum <[email protected]> |
Maintainer: | Eric Hare <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.8 |
Built: | 2025-01-20 02:54:19 UTC |
Source: | https://github.com/alshum/rwunderground |
Weather Alerts for United States and Europe
alerts(location, key = get_api_key(), raw = FALSE, raw_JSON = FALSE, message = TRUE)
alerts(location, key = get_api_key(), raw = FALSE, raw_JSON = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
raw_JSON |
if TRUE return entire alert as JSON |
message |
if TRUE print out requested URL |
A string containing alert type, message, start time and expiration.
## Not run: alerts(set_location(territory = "Hawaii", city = "Honolulu")) alerts(set_location(airport_code = "SEA")) alerts(set_location(zip_code = "90210")) alerts(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: alerts(set_location(territory = "Hawaii", city = "Honolulu")) alerts(set_location(airport_code = "SEA")) alerts(set_location(zip_code = "90210")) alerts(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Average and record high and low temperatures for current date going back as far as weather underground has data or from the national weather service going back 30 years.
almanac(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
almanac(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with columns: location, airport, avg_high, record high, avg_low, record low.
## Not run: almanac(set_location(territory = "Hawaii", city = "Honolulu")) almanac(set_location(airport_code = "SEA")) almanac(set_location(zip_code = "90210")) almanac(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: almanac(set_location(territory = "Hawaii", city = "Honolulu")) almanac(set_location(airport_code = "SEA")) almanac(set_location(zip_code = "90210")) almanac(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
as.numeric with special handling for length 0 (NULL) objects
## S3 method for class 'nonempty' as.numeric(x)
## S3 method for class 'nonempty' as.numeric(x)
x |
the object to cast as numeric |
value of type double
Moon phase, sunrise and sunset times for today.
astronomy(location, key = get_api_key(), raw = FALSE, message = TRUE)
astronomy(location, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with: location, moon phase, percent visible, moon rise and set times, sun rise and set times.
## Not run: astronomy(set_location(territory = "Hawaii", city = "Honolulu")) astronomy(set_location(airport_code = "SEA")) astronomy(set_location(zip_code = "90210")) astronomy(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: astronomy(set_location(territory = "Hawaii", city = "Honolulu")) astronomy(set_location(airport_code = "SEA")) astronomy(set_location(zip_code = "90210")) astronomy(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Base URL for wunderground API
base_url()
base_url()
base wunderground URL
Build wunderground request URL
build_url(key = get_api_key(), request_type, date, location)
build_url(key = get_api_key(), request_type, date, location)
key |
wunderground API key |
request_type |
request type TODO::list all request_types |
date |
Date, only applicable for history requests |
location |
location set by set_location |
Current conditions including current temperature, weather condition, humidity, wind, feels-like, temperature, barometric pressure, and visibility.
conditions(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
conditions(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with conditions
## Not run: conditions(set_location(territory = "Hawaii", city = "Honolulu")) conditions(set_location(airport_code = "SEA")) conditions(set_location(zip_code = "90210")) conditions(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: conditions(set_location(territory = "Hawaii", city = "Honolulu")) conditions(set_location(airport_code = "SEA")) conditions(set_location(zip_code = "90210")) conditions(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Current hurricane - within the US only. Note: all times in eastern
current_hurricane(key = get_api_key(), use_metric = FALSE, raw = FALSE, message = TRUE)
current_hurricane(key = get_api_key(), use_metric = FALSE, raw = FALSE, message = TRUE)
key |
weather underground API key |
use_metric |
Metric or imperial units |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
Hurricane info
## Not run: current_hurricane() ## End(Not run)
## Not run: current_hurricane() ## End(Not run)
In locations with a Daylight Saving/Standard
time change that occurs twice annually, the year has one 23 hour day
and one 25 hour day, if by day we mean "an ordered set of all instants
in time which are assigned the same date". In the US/Los_Angeles
timezone, there is one day in the spring where are no valid times
between the moment before 02:00:00 and 03:00:00. Similarly, there
is one day in the fall where there are two instants described by all
times between 01:00:00 and 01:59:59, first as a set of PDT times, then
as a set of PST times. as.POSIXct()
doesn't handle this case well.
Times inside this region are assigned to DST until the sequence of
clock times has a time which is the same or earlier than its predecessor,
and all subsequent ambiguous times are assigned to Standard Time.
dst_POSIXct(y, m, d, hr, mn, sec, tz)
dst_POSIXct(y, m, d, hr, mn, sec, tz)
y |
vector of years |
m |
vector of months |
d |
vector of days |
hr |
vector of hours |
mn |
vector of minutes |
sec |
vector of seconds |
tz |
vector of timezones |
POSIXct time assuming vectors sorted by true chronological order, at least for the hour that "occurs twice", once with Daylight Time, then again with Standard Time. If there are no nonmonotonicities in the times, all times in this hour will be assumed to be Daylight Time.
Assumes that DST transitions happen on hour boundaries, which is true almost everywhere, and that the wall clock shifts back and repeats exactly 1 hour, again true almost everywhere. This code relies on R and the OS to properly manage DST in all timezones.
dst_repeat_starttime(y, m, d, tz)
dst_repeat_starttime(y, m, d, tz)
y |
the year |
m |
the month |
d |
the day |
tz |
the timezone |
list of two integers betweeen 0000 and 2359, hhmm format. the first integer is the beginning of the interval of clock times which correspond to 2 separate instants of time, the second is the end of that interval. The left endpoint is ambiguous, the right endpoint is not since it maps only to Standard Time.
Processes data.frames and replaces wunderground's -9999/-999 to NAs
encode_NA(df)
encode_NA(df)
df |
the data.frame to process |
data.frame with correctly encoded NAs
Forecast for the next 10 days.
forecast10day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
forecast10day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date (in posix format), high and low temp, conditions, precipitation, rain, snow, max and avg wind speed, max/min and avg humidity
## Not run: forecast10day(set_location(territory = "Hawaii", city = "Honolulu")) forecast10day(set_location(airport_code = "SEA")) forecast10day(set_location(zip_code = "90210")) forecast10day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: forecast10day(set_location(territory = "Hawaii", city = "Honolulu")) forecast10day(set_location(airport_code = "SEA")) forecast10day(set_location(zip_code = "90210")) forecast10day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Forecast for the next 3 days.
forecast3day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
forecast3day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date (in posix format), high and low temp, conditions, precipitation, rain, snow, max and avg wind speed, max/min and avg humidity
## Not run: forecast3day(set_location(territory = "Hawaii", city = "Honolulu")) forecast3day(set_location(airport_code = "SEA")) forecast3day(set_location(zip_code = "90210")) forecast3day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: forecast3day(set_location(territory = "Hawaii", city = "Honolulu")) forecast3day(set_location(airport_code = "SEA")) forecast3day(set_location(zip_code = "90210")) forecast3day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Lists nearby weather stations for a given location
geolookup(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
geolookup(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df of nearby weather stations with: type, city, state, country, id, lat, lon and dist (in either mi or km)
## Not run: geolookup(set_location(territory = "Hawaii", city = "Honolulu")) geolookup(set_location(airport_code = "SEA")) geolookup(set_location(zip_code = "90210")) geolookup(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: geolookup(set_location(territory = "Hawaii", city = "Honolulu")) geolookup(set_location(airport_code = "SEA")) geolookup(set_location(zip_code = "90210")) geolookup(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Returns the wunderground API key
get_api_key()
get_api_key()
API key
## Not run: get_api_key() ## End(Not run)
## Not run: get_api_key() ## End(Not run)
Detects if wunderground API key is set
has_api_key()
has_api_key()
TRUE if API key set, otherwise FALSE
Hourly weather data for specified date.
history(location, date = "20150101", use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
history(location, date = "20150101", use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
date |
Date as YYYYMMDD format |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date, temperature, dew point, humidity, wind speed, gust and direction, visibility, pressure, wind chill, heat index, precipitation, condition, fog, rain, snow, hail, thunder, tornado
## Not run: history(set_location(territory = "Hawaii", city = "Honolulu"), "20130101") history(set_location(airport_code = "SEA"), "20130101") history(set_location(zip_code = "90210"), "20130131") history(set_location(territory = "IR", city = "Tehran"), "20140131") ## End(Not run)
## Not run: history(set_location(territory = "Hawaii", city = "Honolulu"), "20130101") history(set_location(airport_code = "SEA"), "20130101") history(set_location(zip_code = "90210"), "20130131") history(set_location(territory = "IR", city = "Tehran"), "20140131") ## End(Not run)
Summarized weather data for specified date.
history_daily(location, date = "20150101", use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
history_daily(location, date = "20150101", use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
date |
Date as YYYYMMDD format |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df of summarized weather
## Not run: history_daily(set_location(territory = "Hawaii", city = "Honolulu"), "20130101") history_daily(set_location(airport_code = "SEA"), "20130101") history_daily(set_location(zip_code = "90210"), "20130131") history_daily(set_location(territory = "IR", city = "Tehran"), "20140131") ## End(Not run)
## Not run: history_daily(set_location(territory = "Hawaii", city = "Honolulu"), "20130101") history_daily(set_location(airport_code = "SEA"), "20130101") history_daily(set_location(zip_code = "90210"), "20130131") history_daily(set_location(territory = "IR", city = "Tehran"), "20140131") ## End(Not run)
Hourly weather data for specified date range.
history_range(location, date_start = "20150101", date_end = "20150105", limit = 10, no_api = FALSE, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
history_range(location, date_start = "20150101", date_end = "20150105", limit = 10, no_api = FALSE, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
date_start |
start date |
date_end |
end date |
limit |
Maximum number of API requests per minute, NULL to have no limits |
no_api |
bypass API and use URL requests |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date, temperature, dew point, humidity, wind speed, gust and direction, visibility, pressure, wind chill, heat index, precipitation, condition, fog, rain, snow, hail, thunder, tornado
## Not run: history_range(set_location(territory = "Hawaii", city = "Honolulu"), "20130101", "20130105") history_range(set_location(airport_code = "SEA"), "20130101", "20130105") history_range(set_location(zip_code = "90210"), "20130131", "20130205") history_range(set_location(territory = "IR", city = "Tehran"), "20140131", "20140202") ## End(Not run)
## Not run: history_range(set_location(territory = "Hawaii", city = "Honolulu"), "20130101", "20130105") history_range(set_location(airport_code = "SEA"), "20130101", "20130105") history_range(set_location(zip_code = "90210"), "20130131", "20130205") history_range(set_location(territory = "IR", city = "Tehran"), "20140131", "20140202") ## End(Not run)
Hourly forecast for the next 24 hours.
hourly(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
hourly(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date, temperature, dew point, condition, wind speed and direction, UV index, humidity, windchill, heat index, real feel, rain, snow, pop, mslp
## Not run: hourly(set_location(territory = "Hawaii", city = "Honolulu")) hourly(set_location(airport_code = "SEA")) hourly(set_location(zip_code = "90210")) hourly(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: hourly(set_location(territory = "Hawaii", city = "Honolulu")) hourly(set_location(airport_code = "SEA")) hourly(set_location(zip_code = "90210")) hourly(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Hourly forecast for the next 10 days.
hourly10day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
hourly10day(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date, temperature, dew point, condition, wind speed and direction, UV index, humidity, windchill, heat index, real feel, rain, snow, pop, mslp
## Not run: hourly10day(set_location(territory = "Hawaii", city = "Honolulu")) hourly10day(set_location(airport_code = "SEA")) hourly10day(set_location(zip_code = "90210")) hourly10day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
## Not run: hourly10day(set_location(territory = "Hawaii", city = "Honolulu")) hourly10day(set_location(airport_code = "SEA")) hourly10day(set_location(zip_code = "90210")) hourly10day(set_location(territory = "IR", city = "Tehran")) ## End(Not run)
Check if a date is a "fall back" transition from DST.
is_fall_back_day(y, m, d, tz)
is_fall_back_day(y, m, d, tz)
y |
the year |
m |
the month |
d |
the day |
tz |
the timezone |
logical
Checks if airport code is valid
is_valid_airport(name)
is_valid_airport(name)
name |
Airport code either IATA or ICAO |
TRUE if valid otherwise FALSE
Checks if country/state is a valid one
is_valid_territory(name)
is_valid_territory(name)
name |
Name of state or country |
TRUE if valid state or country otherwise FALSE
This dataset is from the openflights.org airport database. It can be found at http://openflights.org/data.html#airport. This data is provided under the open database license – more information can be found here: http://opendatacommons.org/licenses/odbl/1.0/.
list_airports()
list_airports()
data.frame of airport codes with country and city
## Not run: list_airports() ## End(Not run)
## Not run: list_airports() ## End(Not run)
Returns a data.frame of valid countries with iso abbreviations and region
list_countries()
list_countries()
data.frame of valid country names with iso codes
## Not run: list_countries() ## End(Not run)
## Not run: list_countries() ## End(Not run)
Returns a data.frame of valid states with abbreviations and regions
list_states()
list_states()
data.frame of states with abbreviation and region
## Not run: list_states() ## End(Not run)
## Not run: list_states() ## End(Not run)
Lookup airport code (IATA and ICAO code). weatherunderground API might not recognize the IATA/ICAO code for smaller airports.
lookup_airport(location, region = NULL)
lookup_airport(location, region = NULL)
location |
location string |
region |
region string |
data.frame of matching airport name and IATA/ICAO codes
## Not run: lookup_airport("Honolulu") lookup_airport("Pyongyang") lookup_airport("Portland", region = "Los_Angeles") ## End(Not run)
## Not run: lookup_airport("Honolulu") lookup_airport("Pyongyang") lookup_airport("Portland", region = "Los_Angeles") ## End(Not run)
Lookup ISO country code weatherunderground API doesn't recognize iso codes uniformly for every country.name
lookup_country_code(name, region = NULL)
lookup_country_code(name, region = NULL)
name |
Name of country |
region |
Geographic region |
data.frame of country codes
## Not run: lookup_country_code("Korea") lookup_country_code("Guinea", region = "Africa") ## End(Not run)
## Not run: lookup_country_code("Korea") lookup_country_code("Guinea", region = "Africa") ## End(Not run)
Check if a variable exists for a PWS. If not set the value to -9999
measurement_exists(x, class = "numeric")
measurement_exists(x, class = "numeric")
x |
the value to check |
class |
a character given the desired class for the variable |
return object, or NA for length 0 (NULL) objects
nonempty(x)
nonempty(x)
x |
the object to cast as numeric |
value of type double
Weather summary based on historical information between the specified dates
planner(location, use_metric = FALSE, start_date = "0501", end_date = "0531", key = get_api_key(), raw = FALSE, message = TRUE)
planner(location, use_metric = FALSE, start_date = "0501", end_date = "0531", key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
start_date |
Start date as MMDD |
end_date |
End date as MMDD |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df
## Not run: planner(set_location(territory = "Hawaii", city = "Honolulu"), start_date = "0101", end_date = "0131") planner(set_location(territory = "Washington", city = "Seattle"), start_date = "01201", end_date = "1231") planner(set_location(territory = "Louisiana", city = "New Orleans"), start_date = "0501", end_date = "0531") ## End(Not run)
## Not run: planner(set_location(territory = "Hawaii", city = "Honolulu"), start_date = "0101", end_date = "0131") planner(set_location(territory = "Washington", city = "Seattle"), start_date = "01201", end_date = "1231") planner(set_location(territory = "Louisiana", city = "New Orleans"), start_date = "0501", end_date = "0531") ## End(Not run)
Raw Tidal data with data every 5 minutes for US locations Tidal information only available for US cities. Units are in feet.
rawtide(location, key = get_api_key(), raw = FALSE, message = TRUE)
rawtide(location, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with time (epoch) and height
## Not run: rawtide(set_location(territory = "Hawaii", city = "Honolulu")) rawtide(set_location(territory = "Washington", city = "Seattle")) rawtide(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
## Not run: rawtide(set_location(territory = "Hawaii", city = "Honolulu")) rawtide(set_location(territory = "Washington", city = "Seattle")) rawtide(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
Returns image URL for satellite imagery
satellite(location, key = get_api_key(), raw = FALSE, message = TRUE)
satellite(location, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
URL to satellite imagery
## Not run: satellite(set_location(territory = "Hawaii", city = "Honolulu")) satellite(set_location(territory = "Washington", city = "Seattle")) satellite(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
## Not run: satellite(set_location(territory = "Hawaii", city = "Honolulu")) satellite(set_location(territory = "Washington", city = "Seattle")) satellite(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
Sets the wunderground API key
set_api_key(key)
set_api_key(key)
key |
wunderground API key |
API key
## Not run: set_api_key("1a2b3c4d") ## End(Not run)
## Not run: set_api_key("1a2b3c4d") ## End(Not run)
This is a wrapper function that will validate and format location strings for requesting data from weather underground.
set_location(zip_code = NULL, territory = NULL, city = NULL, airport_code = NULL, PWS_id = NULL, lat_long = NULL, autoip = NULL)
set_location(zip_code = NULL, territory = NULL, city = NULL, airport_code = NULL, PWS_id = NULL, lat_long = NULL, autoip = NULL)
zip_code |
zip code |
territory |
state if in US, otherwise country |
city |
city name |
airport_code |
IATA/ICAO airport code |
PWS_id |
personal weather station ID |
lat_long |
latitude and longitude, as a comma-separated string |
autoip |
location based on IP |
formatted and validated location string
set_location(zip_code = "90210") set_location(territory = "Hawaii", city = "Honolulu") set_location(territory = "Kenya", city = "Mombasa") set_location(airport_code = "SEA") set_location(PWS_id = "KMNCHASK10") set_location(lat_long="40.6892,-74.0445") set_location(autoip = "172.227.205.140") set_location()
set_location(zip_code = "90210") set_location(territory = "Hawaii", city = "Honolulu") set_location(territory = "Kenya", city = "Mombasa") set_location(airport_code = "SEA") set_location(PWS_id = "KMNCHASK10") set_location(lat_long="40.6892,-74.0445") set_location(autoip = "172.227.205.140") set_location()
Detect and stop for any wunderground request errors
stop_for_error(httr_parsed_req)
stop_for_error(httr_parsed_req)
httr_parsed_req |
httr request object |
Tidal information for a location within the USA. Tidal information only available for US cities. Units are in feet.
tide(location, key = get_api_key(), raw = FALSE, message = TRUE)
tide(location, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df with date, height and type
## Not run: tide(set_location(territory = "Hawaii", city = "Honolulu")) tide(set_location(territory = "Washington", city = "Seattle")) tide(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
## Not run: tide(set_location(territory = "Hawaii", city = "Honolulu")) tide(set_location(territory = "Washington", city = "Seattle")) tide(set_location(territory = "Louisiana", city = "New Orleans")) ## End(Not run)
Returns locations of personal weather stations along with URLs for their webcam images
webcam(location, key = get_api_key(), raw = FALSE, message = TRUE)
webcam(location, key = get_api_key(), raw = FALSE, message = TRUE)
location |
location set by set_location |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
tbl_df of weather stations including: handle, id, city, state, country, tz, lat, lon, last updated, image URL and cam URL.
## Not run: webcam(set_location(territory = "Hawaii", city = "Honolulu")) webcam(set_location(territory = "Iowa", city = "Iowa City")) webcam(set_location(territory = "Iraq", city = "Baghdad")) ## End(Not run)
## Not run: webcam(set_location(territory = "Hawaii", city = "Honolulu")) webcam(set_location(territory = "Iowa", city = "Iowa City")) webcam(set_location(territory = "Iraq", city = "Baghdad")) ## End(Not run)
wunderground api requests
wunderground_request(request_type, location, date = NULL, key = get_api_key(), message = TRUE)
wunderground_request(request_type, location, date = NULL, key = get_api_key(), message = TRUE)
request_type |
Request type TODO::list all types |
location |
locations set of set_location |
date |
Date, only applicable for history requests |
key |
wunderground API key |
message |
if TRUE print out requested |
httr request object
Weather data for yesterday
yesterday(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE, summary = FALSE)
yesterday(location, use_metric = FALSE, key = get_api_key(), raw = FALSE, message = TRUE, summary = FALSE)
location |
location set by set_location |
use_metric |
Metric or imperial units |
key |
weather underground API key |
raw |
if TRUE return raw httr object |
message |
if TRUE print out requested URL |
summary |
If TRUE return daily summary otherwise hourly data |
tbl_df with date, temperature, dew point, humidity, wind speed, gust and direction, visibility, pressure, wind chill, heat index, precipitation, condition, fog, rain, snow, hail, thunder, tornado
## Not run: yesterday(set_location(territory = "Hawaii", city = "Honolulu")) yesterday(set_location(territory = "Iowa", city = "Iowa City")) yesterday(set_location(territory = "Iraq", city = "Baghdad")) yesterday(set_location(territory = "IR", city = "Tehran"), summary = TRUE) ## End(Not run)
## Not run: yesterday(set_location(territory = "Hawaii", city = "Honolulu")) yesterday(set_location(territory = "Iowa", city = "Iowa City")) yesterday(set_location(territory = "Iraq", city = "Baghdad")) yesterday(set_location(territory = "IR", city = "Tehran"), summary = TRUE) ## End(Not run)