checkDataAvailability: Check if WeatherUnderground has Data for given station and...

Description Usage Arguments Value References Examples

View source: R/wrapper_functions.R

Description

Use this function to check if data is available for station and date If the station code or the date is invalid, function will return 0

Usage

1
checkDataAvailability(station_id, check_date, station_type = "airportCode")

Arguments

station_id

is a valid airport code or a valid Weather Station ID

check_date

is a a valid string representing a date in the past (string "YYYY-MM-DD")

station_type

is either airportCode or id

Value

1 if the station does have weather records for input date, 0 if no records were found

References

For a list of valid Weather Stations, try this format http://www.wunderground.com/weatherstation/ListStations.asp?selectedCountry=United+States and replace with your country of interest

Examples

1
2
3
4
5
## Not run: 
data_okay <- checkDataAvailability("HECA", "2014-01-01")


## End(Not run)

Example output

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

URL does not seem to exist: https://www.wunderground.com/history/airport/HECA/2014/1/1/DailyHistory.html?format=1
The original error message:
Could not resolve host: www.wunderground.comChecking Data Availability For HECA
Data is Not Available
Warning message:
In getDetailedWeather(station_id, check_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.