checkDataAvailabilityForDateRange: Quick Check to see if WeatherUnderground has Weather Data for...

Description Usage Arguments Value Examples

View source: R/wrapper_functions.R

Description

Before we attempt to fetch the data for a big time interval of dates, this function is useful to see if the data even exists. @details This functions checks for just the first and the last date in the interval, not the days in between

Usage

1
2
checkDataAvailabilityForDateRange(station_id, start_date, end_date,
  station_type = "airportCode")

Arguments

station_id

is a valid 3-letter airport code or a valid Weather Station ID

start_date

is a valid string representing a date in the past (YYYY-MM-DD, all numeric)

end_date

is a a valid string representing a date in the past (YYYY-MM-DD, all numeric) and is greater than start_date

station_type

is either airportCode or id

Value

1 if the Station did have weather records, 0 if nothing was found

Examples

1
2
3
4
5
6
## Not run: 
data_okay <- checkDataAvailabilityForDateRange("BOS", 
                                               "2011-01-01", 
                                               "2011-03-31")

## End(Not run)

Example output

Getting data from:
 https://www.wunderground.com/history/airport/BOS/2011/1/1/DailyHistory.html?format=1

URL does not seem to exist: https://www.wunderground.com/history/airport/BOS/2011/1/1/DailyHistory.html?format=1
The original error message:
Could not resolve host: www.wunderground.comGetting data from:
 https://www.wunderground.com/history/airport/BOS/2011/3/31/DailyHistory.html?format=1

URL does not seem to exist: https://www.wunderground.com/history/airport/BOS/2011/3/31/DailyHistory.html?format=1
The original error message:
Could not resolve host: www.wunderground.comChecking Data Availability For BOS
Found 0 records for 2011-01-01
Found 0 records for 2011-03-31
Data is Not Available

Warning messages:
1: In getDetailedWeather(station_id, start_date, station_type, opt_temperature_columns = T,  :
  Unable to get data from URL
 Check if URL is reachable
2: In getDetailedWeather(station_id, end_date, station_type, opt_temperature_columns = T,  :
  Unable to get data from URL
 Check if URL is reachable

weatherData documentation built on June 6, 2017, 1:02 a.m.