knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

gsod: Tools for using NOAA Global Surface Summary of the Day data

Installation

if(!require(devtools)) install.packages("devtools")
install_github('databrew/gsod')
knitr::opts_chunk$set(echo = TRUE,
                      fig.width = 4,
                      fig.height = 4)
library(dplyr)
library(tidyr)
library(ggplot2)
library(gsod)

Purpose

GSOD data, with daily meterological summaries of over 9,000 weather stations around the world, is large, stored in tens of thousands of different files, and a bit difficult to quickly access and use. The purpose of the gsod package is to make accessing and analyzing GSOD data quicker and easier.

Use

The gsod package consists of 18 dataframes, one for each year from 2000 through 2017. To access any of these dataframes, simply attach the package and then type gsod<year>. For example:

library(gsod)
my_data <- gsod2016
head(my_data)

Examples

Get conditions at every weather station on July 1, 2016.

library(gsod)
library(tidyverse)
avg_temp <- 
  gsod2016 %>%
  filter(date == '2016-07-01') 

Plot

library(rworldmap)
library(ggplot2)
world <- map_data(map="world")

ggplot() + 
  geom_map(data=world, 
           map=world,
           aes(map_id=region, x=long, y=lat),
           fill = 'black',
           alpha = 0.6) +
  geom_point(data = avg_temp,
             aes(x = lon,
                 y = lat,
                 color = visib),
             alpha = 0.6,
             size = 0.05) +
  scale_color_continuous(na.value = NA,
                         name = 'Visibility',
                         low = 'yellow',
                         high = 'blue') +
  labs(x = 'Longitude',
       y = 'Latitude') +
  theme(legend.position = 'bottom')

Vignette

A package vignette with more examples is available on the DataBrew website.

Why gsod?

The main advantage of using the gsod package over alternatives is speed: rather than interacting with NOAA's FTP server, using the gsod package means you have the data on your hard drive upon installation, and can get into an R session quickly. If you want more flexibility, need live up-to-date data, or want more control over the formatting, units, and uncertainty around these data, you should consult the README of the GSODR package, which dives into more detail about the data source, and also gives an overview of available alternatives.

This package owes a debt of gratitude to the work carried out in the GSODR package. Specifically, it relied heavily on the GSODR::reformat_GSOD function to "clean up" the data prior to storage.

WMO Resolution 40. NOAA Policy

Users of these data should take into account the following (from the NCEI website):

"The following data and products may have conditions placed on their international commercial use. They can be used within the U.S. or for non-commercial international activities without restriction. The non-U.S. data cannot be redistributed for commercial purposes. Re-distribution of these data by others must provide this same notification." WMO Resolution 40. NOAA Policy

Contact

DataBrew

databrew



databrew/gsod documentation built on May 20, 2019, 8:48 a.m.