Learn R Programming

weatherData (version 0.5.0)

checkSummarizedDataAvailability: Quick Check to see if WeatherUnderground has Summarized Weather Data for given station for a custom range of dates

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 build a custom URL and checks for the data. If available, it will find one row for each date in the date range.

Usage

checkSummarizedDataAvailability(station_id, start_date, end_date = NULL,
  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. Default is NULL, in which case the end_date is taken to the same as the start_date

station_type

is either airportCode or id

Value

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

Examples

Run this code

data_okay <- checkSummarizedDataAvailability("GIG", 
                                             "2000-01-01",
                                             "2005-12-31")

Run the code above in your browser using DataLab