| Title: | Airport Weather Station Statistics |
|---|---|
| Description: | Download daily weather data recorded at airport weather stations using the National Centers for Environmental Information (NCEI) API <https://www.ncei.noaa.gov/support/access-search-service-api-user-documentation>. |
| Authors: | Peter Hoff [aut, cre] |
| Maintainer: | Peter Hoff <[email protected]> |
| License: | GPL (>=3) |
| Version: | 0.1 |
| Built: | 2026-05-18 10:15:59 UTC |
| Source: | https://github.com/pdhoff/weatherstats |
Celsius to Fahrenheit temperature coversion
c2f(x)c2f(x)
x |
temperature in Celsius |
temperature in Fahrenheit
Peter Hoff
Fahrenheit to Celsius temperature coversion
f2c(y)f2c(y)
y |
temperature in Fahrenheit |
temperature in Celsius
Peter Hoff
Extract indices of a particular month from ISO 8601 format
isMonth(dates, month)isMonth(dates, month)
dates |
a vector of character dates in IS( 8601 format |
month |
an integer from 1 to 12 |
a vector of matching indices
Peter Hoff
Two years of weather data at RDU.
RDURDU
A data frame with dates along the rows, variables along the columns.
Derived from original data at https://example.org
One year of weather data at SEA.
SEASEA
A data frame with dates along the rows, variables along the columns.
Downloaded via the NCEI API <https://www.ncei.noaa.gov/support/access-search-service-api-user-documentation>.
Extract and combine temperature and precipitation data
tpdata(...)tpdata(...)
... |
either a list or sequence of data matrices obtained from 'weatherStats' |
a data frame
Peter Hoff
W<-tpdata(RDU,SEA) colnames(W) dim(W) tpplot(W)W<-tpdata(RDU,SEA) colnames(W) dim(W) tpplot(W)
Plot temperature and precipitation data
tpplot(TPDATA, units = "F", rc = "col")tpplot(TPDATA, units = "F", rc = "col")
TPDATA |
A data frame with temperature and precipitation data |
units |
"F" or "C" |
rc |
make multiple plots along columns ("col") or rows ("row") |
Invisibly returns NULL.
Peter Hoff
W<-tpdata(RDU,SEA) colnames(W) dim(W) tpplot(W)W<-tpdata(RDU,SEA) colnames(W) dim(W) tpplot(W)
Download weather data from the National Centers for Environmental Information (NCEI) using their API.
weatherStats( FAAID, year = NULL, startDate = NULL, endDate = NULL, trimNA = TRUE, maxTries = 5, tpause = 3, verbose = TRUE )weatherStats( FAAID, year = NULL, startDate = NULL, endDate = NULL, trimNA = TRUE, maxTries = 5, tpause = 3, verbose = TRUE )
FAAID |
Federal Aviation Administration (FAA) station ID |
year |
year for which data are to be downloaded |
startDate |
start date in YY-MM-DD format |
endDate |
end date in YY-MM-DD format |
trimNA |
remove days with no data |
maxTries |
maximum number of query attempts to the NCEI server |
tpause |
time in seconds to pause between API requests |
verbose |
a logical value indicating whether to report download progress |
a data frame with daily weather data
Peter Hoff
RDU<-weatherStats("RDU",startDate="2024-01-01",endDate="2025-12-31") SEA<-weatherStats("SEA",year=2025) dim(RDU) dim(SEA) colnames(SEA)RDU<-weatherStats("RDU",startDate="2024-01-01",endDate="2025-12-31") SEA<-weatherStats("SEA",year=2025) dim(RDU) dim(SEA) colnames(SEA)