A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

GSODR

Global Surface Summary of the Day Weather Data Client for R.
https://github.com/ropensci/GSODR

Category: Climate Change
Sub Category: Climate Data Access and Visualization

Keywords

daily-data daily-weather data-access global-data gsod historical-data historical-weather ncdc ncei r r-package rstats weather weather-data weather-information weather-stations

Keywords from Contributors

cycle routes setup unconf hydrology climate geocoding hugo openscience crossref-api

Last synced: about 18 hours ago
JSON representation

Repository metadata

API Client for Global Surface Summary of the Day (GSOD) Weather Data Client in R

README.Rmd

          ---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# {GSODR}: Global Surface Summary of the Day (GSOD) Weather Data Client logo


[![R-CMD-check](https://github.com/ropensci/GSODR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/GSODR/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/ropensci/GSODR/graph/badge.svg?token=7KOFeomenq)](https://app.codecov.io/gh/ropensci/GSODR)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.439850.svg)](https://doi.org/10.5281/zenodo.439850) 
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/GSODR)](https://cran.r-project.org/package=GSODR)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) 
[![JOSS](http://joss.theoj.org/papers/10.21105/joss.00177/status.svg)](https://joss.theoj.org/papers/10.21105/joss.00177) 
[![](https://badges.ropensci.org/79_status.svg)](https://github.com/ropensci/software-review/issues/79)


## Introduction

The GSOD or [Global Surface Summary of the Day (GSOD)](https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C00516) 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 six 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 `data.table` of stations with their metadata and the distance in which they fall from the given radius (kilometres) of a point given as latitude and longitude in order from nearest to farthest.

- `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.

- `get_history()` - this function downloads the latest version of the isd-history.csv file from the NCEI's server and returns a {data.table} of the information for each station that is available. A version of this file is distributed with {GSODR} internally and can be updated with `update_internal_isd_history()`.

- `get_updates()` - this function downloads the changelog for the GSOD data from the NCEI's server and reorders it by the most recent changes first.

- `update_internal_isd_history()` - this function downloads the latest station list from the NCEI's server updates the package's internal database of stations and their metadata. **Not recommended for normal use.**

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).

For more information see the description of the data provided by NCEI, .

## How to Install

### Stable Version

A stable version of {GSODR} is available from [CRAN](https://cran.r-project.org/package=GSODR).

```r
install.packages("GSODR")
```

### Development Version

A development version is available from from GitHub.
If you wish to install the development version that may have new features or bug fixes before the CRAN version does (but also may not work properly), please install from the [rOpenSci R Universe](https://ropensci.org/r-universe/).
We strive to keep the main branch on GitHub functional and working properly.

```r
install.packages("GSODR", repos = "https://ropensci.r-universe.dev")
```

## Using {GSODR}

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.

```{r example}
library(GSODR)
tbar <- get_GSOD(years = 2021, station = "955510-99999")
tbar
```

## Other Sources of Weather Data in R

There are several other sources of weather data and ways of retrieving them through R.
Several are also [rOpenSci](https://ropensci.org) projects.

[{clifro}](https://CRAN.R-project.org/package=clifro) from [rOpenSci](https://docs.ropensci.org/clifro/) is a web portal to the New Zealand National Climate Database and provides public access (via subscription) to around 6,500 various climate stations (see  for more information).
Collating and manipulating data from CliFlo (hence clifro) and importing into R for further analysis, exploration and visualisation is now straightforward and coherent.
The user is required to have an Internet connection, and a current CliFlo subscription (free) if data from stations, other than the public Reefton electronic weather station, is sought.

[{GSODTools}](https://github.com/environmentalinformatics-marburg/GSODTools) by [Florian Detsch](https://github.com/fdetsch) is an R package that offers similar functionality as {GSODR}, but also has the ability to graph the data and working with data for time series analysis.

[{nasapower}](https://CRAN.R-project.org/package=nasapower) from [rOpenSci](https://docs.ropensci.org/nasapower/) aims to make it quick and easy to automate downloading of the NASA-POWER global meteorology, surface solar energy and climatology data in your R session as a tidy `tibble` object for analysis and use in modelling or other purposes.
POWER (Prediction Of Worldwide Energy Resource) data are freely available for download with varying spatial resolutions dependent on the original data and with several temporal resolutions depending on the POWER parameter and community.

[{riem}](https://CRAN.R-project.org/package=riem) from [rOpenSci](https://docs.ropensci.org/riem/) allows to get weather data from Automated Surface Observing System (ASOS) stations (airports) in the whole world thanks to the Iowa Environment Mesonet website.

[{rnoaa}](https://CRAN.R-project.org/package=rnoaa), from [rOpenSci](https://docs.ropensci.org/rnoaa/) offers tools for interacting with and downloading weather data from the United States National Oceanic and Atmospheric Administration but lacks support for GSOD data.

[{stationaRy}](https://cran.r-project.org/package=stationaRy), from Richard Iannone offers hourly meteorological data from stations located all over the world.
There is a wealth of data available, with historic weather data accessible from nearly 30,000 stations.

[{weathercan}](https://CRAN.R-project.org/package=weathercan) from [rOpenSci](https://github.com/ropensci/weathercan) makes it easier to search for and download multiple months/years of historical weather data from Environment and Climate Change Canada (ECCC) website.

[{weatherOz}](https://CRAN.R-project.org/package=weatherOz) aims to facilitate access and download weather and climate data for Australia from Australian data sources.
Data are sourced from from the Western Australian Department of Primary Industries and Regional Development (DPIRD) and the Scientific Information for Land Owners (SILO) API endpoints and the Australian Government Bureau of Meteorology’s (BOM) FTP server.

[{worldmet}](https://CRAN.R-project.org/package=worldmet) provides an easy way to access data from the NOAA Integrated Surface Database (ISD) (the same database {GSODR} provides access to.
The ISD contains detailed surface meteorological data from around the world for over 35,000 locations.
However, rather than daily values, the package outputs (typically hourly meteorological data) and works very well with the [{openair}](https://CRAN.R-project.org/package=openair) package.

## Notes

### Citing GSOD data

> 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].

### NOAA policy

Users of these data should take into account the following:

> The data summaries provided here are based on data exchanged under the World Meteorological Organization (WMO) World Weather Watch Program according to WMO Resolution 40 (Cg-XII). This allows WMO member countries to place restrictions on the use or re-export of their data for commercial purposes outside of the receiving country.
Data for selected countries may, at times, not be available through this system.
Those countries' data summaries and products which are available here are intended for free and unrestricted use in research, education, and other non-commercial activities.
However, for non-U.S. locations' data, the data or any derived product shall not be provided to other users or be used for the re-export of commercial services.

## Meta

- Please [report any issues or bugs](https://github.com/ropensci/GSODR/issues).

- License: MIT

- To cite {GSODR}, please use: Adam H. Sparks, Tomislav Hengl and Andrew Nelson (2017). GSODR: Global Summary Daily Weather Data in R. _The Journal of Open Source Software_, **2(10)**. DOI: 10.21105/joss.00177.

## Code of Conduct
  
Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). 
By contributing to this project, you agree to abide by its terms.

## References

Alduchov, O.A. and Eskridge, R.E., 1996. Improved Magnus form approximation of saturation vapor pressure. Journal of Applied Meteorology and Climatology, 35(4), pp. 601-609 DOI: 10.1175/1520-0450(1996)035<0601:IMFAOS>2.0.CO;2.

## Contributors






All contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome!

### Code


adamhsparks

cboettig

karthik

noamross
### Issue Authors

pat-s

jeffreyhanson

tosinaregbs

pssguy

amshew

sachserf

emdelponte

choisy

sckott

EFreiberger

ssomani10

taraskaduk

oxalisids

rogarui

dvictori

hubbarsc

meixilin

barryrowlingson

femiguez

r-3141592-pi

moyourao
### Issue Contributors

amine67

ckumarMT

GwenGitHub

thengl

lukuxus

rsmiller74

fdetsch

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 2,236
Total Committers: 7
Avg Commits per committer: 319.429
Development Distribution Score (DDS): 0.006

Commits in past year: 69
Committers in past year: 2
Avg Commits per committer in past year: 34.5
Development Distribution Score (DDS) in past year: 0.014

Name Email Commits
Adam H. Sparks a****s@g****m 2223
Ubuntu u****u@s****l 6
Tomislav Hengl t****l@i****g 3
Noam Ross n****s@g****m 1
Karthik Ram k****m@g****m 1
Josiah Parry j****y@g****m 1
Carl Boettiger c****g@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 67
Total pull requests: 41
Average time to close issues: 26 days
Average time to close pull requests: about 4 hours
Total issue authors: 22
Total pull request authors: 5
Average comments per issue: 2.82
Average comments per pull request: 0.05
Merged pull request: 39
Bot issues: 0
Bot pull requests: 0

Past year issues: 6
Past year pull requests: 7
Past year average time to close issues: 5 days
Past year average time to close pull requests: about 7 hours
Past year issue authors: 5
Past year pull request authors: 2
Past year average comments per issue: 2.83
Past year average comments per pull request: 0.0
Past year merged pull request: 7
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ropensci/GSODR

Top Issue Authors

  • adamhsparks (43)
  • taraskaduk (2)
  • pat-s (2)
  • tosinaregbs (2)
  • hubbarsc (1)
  • choisy (1)
  • dvictori (1)
  • amshew (1)
  • rogarui (1)
  • sachserf (1)
  • emdelponte (1)
  • EFreiberger (1)
  • pssguy (1)
  • sckott (1)
  • meixilin (1)

Top Pull Request Authors

  • adamhsparks (37)
  • noamross (1)
  • karthik (1)
  • JosiahParry (1)
  • cboettig (1)

Top Issue Labels

  • enhancement (11)
  • bug (4)
  • question (1)

Top Pull Request Labels


Package metadata

proxy.golang.org: github.com/ropensci/GSODR

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/ropensci/GSODR#section-documentation
  • Licenses: other
  • Latest release: v4.1.2+incompatible (published 8 months ago)
  • Last Synced: 2025-04-25T12:09:42.639Z (2 days ago)
  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 9.049%
    • Average: 9.627%
    • Dependent repos count: 10.204%
proxy.golang.org: github.com/ropensci/gsodr

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/ropensci/gsodr#section-documentation
  • Licenses: other
  • Latest release: v4.1.2+incompatible (published 8 months ago)
  • Last Synced: 2025-04-25T12:09:42.828Z (2 days ago)
  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 9.049%
    • Average: 9.627%
    • Dependent repos count: 10.204%
cran.r-project.org: GSODR

Global Surface Summary of the Day ('GSOD') Weather Data Client

  • Homepage: https://docs.ropensci.org/GSODR/
  • Documentation: http://cran.r-project.org/web/packages/GSODR/GSODR.pdf
  • Licenses: MIT + file LICENSE
  • Latest release: 4.1.3 (published 6 months ago)
  • Last Synced: 2025-04-25T12:09:43.116Z (2 days ago)
  • Versions: 49
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 793 Last month
  • Docker Downloads: 130,623
  • Rankings:
    • Docker downloads count: 0.045%
    • Average: 13.532%
    • Downloads: 16.67%
    • Dependent packages count: 18.148%
    • Dependent repos count: 19.265%
  • Maintainers (1)

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • R.utils * imports
  • countrycode * imports
  • curl * imports
  • data.table * imports
  • httr * imports
  • stats * imports
  • utils * imports
  • dplyr * suggests
  • ggplot2 * suggests
  • gridExtra * suggests
  • knitr * suggests
  • mapproj * suggests
  • maps * suggests
  • remotes * suggests
  • rmarkdown * suggests
  • roxygen2 * suggests
  • spelling * suggests
  • testthat * suggests
  • tidyr * suggests
.github/workflows/tic.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v2 composite
  • pat-s/always-upload-cache v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/update-tic.yml actions
  • actions/checkout v3 composite
  • peter-evans/create-pull-request v4 composite
  • r-lib/actions/setup-r v2 composite

Score: 18.264701267896218