Shape ICTforAg Learning Network's future with us during our exclusive limited preview – your feedback drives our development!Connect with us at learningnetwork@ictforag.com
Source code

GSODR

The GSOD or Global Surface Summary of the Day (GSOD) data provided by the US National Centers for Environmental Information (NCEI) are a valuable source of weather data with global coverage. {GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides five main functions for facilitating this: get_GSOD() - this function queries and transfers files from the NCEI's web server, reformats them and returns a data frame. reformat_GSOD() - this function takes individual station files from the local disk and re-formats them returning a data frame. nearest_stations() - this function returns a vector of station IDs that fall within the given radius (kilometres) of a point given as latitude and longitude in order from nearest to farthest. update_station_list() - this function downloads the latest station list from the NCEI's server updates the package's internal database of stations and their metadata. get_inventory() - this function downloads the latest station inventory information from the NCEI's server and returns the header information about the latest version as a message in the console and a tidy data frame of the stations' inventory for each month that data are reported. When reformatting data either with get_GSOD() or reformat_GSOD(), all units are converted to International System of Units (SI), e.g., inches to millimetres and Fahrenheit to Celsius. File output is returned as a data.table object, summarising each year by station, which also includes vapour pressure and relative humidity elements calculated from existing data in GSOD. Additional data are calculated by this R package using the original data and included in the final data. These include vapour pressure (ea and es) and relative humidity calculated using the improved August-Roche-Magnus approximation (Alduchov and Eskridge 1996).

Country Applicable

Country-flag Global

Authors/Contributors

Adam H. Sparks Karthik Ram Carl Boettiger Noam Ross