get_station_data: Organize .dly weather data downloaded from the web.

Description Usage Arguments Value Functions Examples

View source: R/get_station_data.R

Description

These functions are designed to take NOAA weather data organized in .dly format, extract snow depth, WESD, or other climate information, and return a neatly organized data frame.

Usage

1
2
3
4
5
get_station_data(stations, source, elem = c("SNWD", "WESD"), progress = TRUE)

get_state_data(states, source, elem = c("SNWD", "WESD"), progress = TRUE)

get_region_data(eco_regions, source, elem = c("SNWD", "WESD"), progress = TRUE)

Arguments

stations

A vector of station identification codes. See the internal data set ghcnd_stations for station id's and descriptions.

source

If downloading from the web, source should be "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/all/".

elem

The climate variables to extract. Default is snow depth in mm ("SNWD") and water depth equivalent of snowfall in mm ("WESD"). For other climate variables see section three of ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt.

progress

If true, a text progress bar is printed to the console. Only relevant when more than one station is requested.

states

A vector of states, see the internal data set ghcnd_stations for valid states and associated stations.

eco_regions

A vector of eco_regions, see the internal data set ghcnd_stations for valid eco_regions and associated stations. eco_regions can be either level 3 eco regions (e.g. "8.2.4"), level 2 regions (e.g. "8.2"), or level 1 regions (e.g. "8").

Value

A data.frame where each row is a measurement of a climate variable in elem for a single day and station. Columns are:

ID - The station identification code. See the internal data set ghcnd_stations for station id's and descriptions.

DATE - The date of the measurement.

ELEMENT - The climate variable measured. See ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt, section 3 for a description of climate variables.

VALUE - The measurement of the ELEMENT on the given DATE.

MFLAG - A measurement flag. See ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt, section 3 for a description of the flag.

QFLAG - A quality flag. See ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt, section 3 for a description of the flag.

SFLAG - A source flag. See ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt, section 3 for a description of the flag.

ECO3 - Identifier for the EPA level 3 ecoregion where the station is located.

Functions

Examples

1
2
get_station_data(ghcnd_stations$ID[10000],
                 "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/all/")

scoutiii/HTSoutliers documentation built on April 4, 2021, 4:47 p.m.