
The GSOD orGlobalSurface Summary of the Day (GSOD) data provided by the US NationalCenters for Environmental Information (NCEI) are a valuable source ofweather data with global coverage. {GSODR} aims to make it easy to find,transfer and format the data you need for use in analysis and providesfour main functions for facilitating this:
get_GSOD() - this function queries and transfersfiles from the NCEI’s web server, reformats them and returns a dataframe.
reformat_GSOD() - this function takes individualstation files from the local disk and re-formats them returning a dataframe.
nearest_stations() - this function returns adata.table of stations with their metadata and the distancein which they fall from the given radius (kilometres) of a point givenas latitude and longitude in order from nearest to farthest.
get_updates() - this function downloads thechangelog for the GSOD data from the NCEI’s server and reorders it bythe most recent changes first.
When reformatting data either withget_GSOD() orreformat_GSOD(), all units are converted to InternationalSystem of Units (SI),e.g., inches to millimetres andFahrenheit to Celsius. File output is returned as adata.table object, summarising each year by station, whichalso includes vapour pressure and relative humidity elements calculatedfrom existing data in GSOD. Additional data are calculated by this Rpackage using the original data and included in the final data. Theseinclude vapour pressure (ea and es) and relative humidity calculatedusing the improved August-Roche-Magnus approximation (Alduchov andEskridge 1996).
For more information see the description of the data provided byNCEI,https://www.ncei.noaa.gov/data/global-summary-of-the-day/doc/readme.txt.
A stable version of {GSODR} is available fromCRAN.
install.packages("GSODR")A development version is available from from GitHub. If you wish toinstall the development version that may have new features or bug fixesbefore the CRAN version does (but also may not work properly), pleaseinstall from therOpenSci RUniverse. We strive to keep the main branch on GitHub functional andworking properly.
install.packages("GSODR",repos ="https://ropensci.r-universe.dev")The most common work might be getting data for a single location.Here’s an example of fetching data for a station in Toowoomba,Queensland, AU in 2021.
library(GSODR)tbar<-get_GSOD(years =2021,station ="955510-99999")tbar#> STNID NAME CTRY COUNTRY_NAME ISO2C ISO3C STATE#> <char> <char> <char> <char> <char> <char> <char>#> 1: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 2: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 3: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 4: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 5: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> ---#> 358: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 359: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 360: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 361: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> 362: 955510-99999 TOOWOOMBA AIRPORT AS AUSTRALIA AU AUS#> LATITUDE LONGITUDE ELEVATIONBEGINEND YEARMODA YEAR MONTH#> <num> <num> <num> <int> <int> <Date> <int> <int>#> 1: -27.55 151.917 642 19980301 20250824 2021-01-01 2021 1#> 2: -27.55 151.917 642 19980301 20250824 2021-01-02 2021 1#> 3: -27.55 151.917 642 19980301 20250824 2021-01-03 2021 1#> 4: -27.55 151.917 642 19980301 20250824 2021-01-04 2021 1#> 5: -27.55 151.917 642 19980301 20250824 2021-01-05 2021 1#> ---#> 358: -27.55 151.917 642 19980301 20250824 2021-12-27 2021 12#> 359: -27.55 151.917 642 19980301 20250824 2021-12-28 2021 12#> 360: -27.55 151.917 642 19980301 20250824 2021-12-29 2021 12#> 361: -27.55 151.917 642 19980301 20250824 2021-12-30 2021 12#> 362: -27.55 151.917 642 19980301 20250824 2021-12-31 2021 12#> DAY YDAY TEMP TEMP_ATTRIBUTES DEWP DEWP_ATTRIBUTES SLP#> <int> <int> <num> <int> <num> <int> <num>#> 1: 1 1 20.9 16 18.1 15 1011.5#> 2: 2 2 21.2 16 17.8 16 1009.1#> 3: 3 3 21.0 16 19.2 16 1008.3#> 4: 4 4 22.2 16 19.4 15 1008.6#> 5: 5 5 23.6 16 19.8 16 1009.3#> ---#> 358: 27 361 20.5 24 16.2 24 1009.3#> 359: 28 362 16.7 24 13.1 24 1012.0#> 360: 29 363 18.1 24 13.7 24 1012.4#> 361: 30 364 18.4 24 13.5 24 1012.6#> 362: 31 365 18.4 24 17.0 21 1010.9#> SLP_ATTRIBUTES STP STP_ATTRIBUTES VISIB VISIB_ATTRIBUTES WDSP#> <int> <num> <int> <num> <int> <num>#> 1: 16 940.5 16 NA 0 8.0#> 2: 16 938.2 16 NA 0 6.2#> 3: 16 937.4 16 NA 0 4.9#> 4: 16 937.7 16 NA 0 3.9#> 5: 16 938.4 16 NA 0 3.4#> ---#> 358: 24 938.1 24 NA 0 7.0#> 359: 24 940.7 24 NA 0 8.2#> 360: 24 941.0 24 NA 0 8.7#> 361: 24 941.2 24 NA 0 8.4#> 362: 24 939.7 24 NA 0 9.2#> WDSP_ATTRIBUTES MXSPD GUST MAX MAX_ATTRIBUTES MIN MIN_ATTRIBUTES#> <int> <num> <num> <num> <char> <num> <char>#> 1: 16 9.8 NA 25.6 * 16.7 <NA>#> 2: 16 9.3 NA 25.7 * 17.6 <NA>#> 3: 16 8.2 NA 25.5 * 17.7 <NA>#> 4: 16 5.7 NA 25.0 * 18.8 <NA>#> 5: 16 7.7 NA 28.1 * 19.0 <NA>#> ---#> 358: 24 9.8 NA 27.2 * 17.0 *#> 359: 24 10.8 NA 20.2 * 13.5 *#> 360: 24 10.8 NA 24.0 * 13.4 <NA>#> 361: 24 11.8 NA 24.5 * 13.9 <NA>#> 362: 24 12.3 NA 22.2 * 14.8 <NA>#> PRCP PRCP_ATTRIBUTES SNDP I_FOG I_RAIN_DRIZZLE I_SNOW_ICE I_HAIL#> <num> <char> <num> <num> <num> <num> <num>#> 1: 2.03 G NA 1 1 0 0#> 2: 0.25 G NA 0 0 0 0#> 3: 19.05 G NA 1 1 0 0#> 4: 0.25 G NA 0 0 0 0#> 5: 0.51 G NA 0 0 0 0#> ---#> 358: 0.00 I NA 0 0 0 0#> 359: 0.00 I NA 0 0 0 0#> 360: 0.00 I NA 0 0 0 0#> 361: 0.25 G NA 0 1 0 0#> 362: 7.11 G NA 0 1 0 0#> I_THUNDER I_TORNADO_FUNNEL EA ES RH#> <num> <num> <num> <num> <num>#> 1: 0 0 2.1 2.5 84.0#> 2: 0 0 2.0 2.5 81.0#> 3: 0 0 2.2 2.5 89.5#> 4: 0 0 2.2 2.7 84.2#> 5: 0 0 2.3 2.9 79.3#> ---#> 358: 0 0 1.8 2.4 76.4#> 359: 0 0 1.5 1.9 79.3#> 360: 0 0 1.6 2.1 75.5#> 361: 0 0 1.5 2.1 73.1#> 362: 0 0 1.9 2.1 91.6There are several other sources of weather data and ways ofretrieving them through R. Several are alsorOpenSci projects.
{GSODTools}byFlorian Detsch is an Rpackage that offers similar functionality as {GSODR}, but also has theability to graph the data and working with data for time seriesanalysis.
{nasapower} fromrOpenSci aims to makeit quick and easy to automate downloading of the NASA-POWER globalmeteorology, surface solar energy and climatology data in your R sessionas a tidytibble object for analysis and use in modellingor other purposes. POWER (Prediction Of Worldwide Energy Resource) dataare freely available for download with varying spatial resolutionsdependent on the original data and with several temporal resolutionsdepending on the POWER parameter and community.
{riem} fromrOpenSci allows to getweather data from Automated Surface Observing System (ASOS) stations(airports) in the whole world thanks to the Iowa Environment Mesonetwebsite.
{rnoaa}, fromrOpenSci offers tools forinteracting with and downloading weather data from the United StatesNational Oceanic and Atmospheric Administration but lacks support forGSOD data.
{stationaRy},from Richard Iannone offers hourly meteorological data from stationslocated all over the world. There is a wealth of data available, withhistoric weather data accessible from nearly 30,000 stations.
{weathercan}fromrOpenSci makesit easier to search for and download multiple months/years of historicalweather data from Environment and Climate Change Canada (ECCC)website.
{weatherOz} aimsto facilitate access and download weather and climate data for Australiafrom Australian data sources. Data are sourced from from the WesternAustralian Department of Primary Industries and Regional Development(DPIRD) and the Scientific Information for Land Owners (SILO) APIendpoints and the Australian Government Bureau of Meteorology’s (BOM)FTP server.
{worldmet}provides an easy way to access data from the NOAA Integrated SurfaceDatabase (ISD) (the same database {GSODR} provides access to. The ISDcontains detailed surface meteorological data from around the world forover 35,000 locations. However, rather than daily values, the packageoutputs (typically hourly meteorological data) and works very well withthe{openair}package.
Cite as: NOAA National Centers of Environmental Information. 1999.Global Surface Summary of the Day - GSOD. 1.0. [indicate subset used].NOAA National Centers for Environmental Information. Accessed[date].
Users of these data should take into account the following:
The data summaries provided here are based on data exchanged underthe World Meteorological Organization (WMO) World Weather Watch Programaccording to WMO Resolution 40 (Cg-XII). This allows WMO membercountries to place restrictions on the use or re-export of their datafor commercial purposes outside of the receiving country. Data forselected countries may, at times, not be available through this system.Those countries’ data summaries and products which are available hereare intended for free and unrestricted use in research, education, andother non-commercial activities. However, for non-U.S. locations’ data,the data or any derived product shall not be provided to other users orbe used for the re-export of commercial services.
Pleasereportany issues or bugs.
License: MIT
To cite {GSODR}, please use: Adam H. Sparks, Tomislav Hengl andAndrew Nelson (2017). GSODR: Global Summary Daily Weather Data in R.The Journal of Open Source Software,2(10).DOI: 10.21105/joss.00177.
Please note that this package is released with aContributor Code ofConduct. By contributing to this project, you agree to abide by itsterms.
Alduchov, O.A. and Eskridge, R.E., 1996. Improved Magnus formapproximation of saturation vapor pressure. Journal of AppliedMeteorology and Climatology, 35(4), pp. 601-609 DOI:10.1175/1520-0450(1996)035<0601:IMFAOS>2.0.CO;2.