anyflights (version 0.1.0)

get_weather: Generate a weather dataset for the specified year and airport

Description

Please note that, even with a strong internet connection, this function may take several minutes to download relevant data.

Usage

get_weather(station, year, dir)

Arguments

station

A character string---the airport of interest (use the FAA LID airport code).

year

The year of interest, as an integer (unquoted). Currently, years 2015 and on are supported.

dir

The folder for the dataset to be saved in

Value

A data frame with ~25,000 rows and 15 variables:

origin

Weather station. Named origin to facilitate merging with flights data

year,month,day,hour

Time of recording

temp,dewp

Temperature and dewpoint in F

humid

Relative humidity

wind_dir,wind_speed,wind_gust

Wind direction (in degrees), speed and gust speed (in mph)

precip

Precipitation, in inches

pressure

Sea level pressure in millibars

visib

Visibility in miles

time_hour

Date and hour of the recording as a POSIXct date

See Also

get_flights for flight data, get_airports for airport data, get_airlines for airline data, and anyflights for a wrapper function

Examples

Run this code
# NOT RUN {
get_weather(station = "PDX", year = 2015, dir = tempdir())
# }

Run the code above in your browser using DataLab