ws_data_avg_span_2_pgdb: ws_data_avg_span_2_pgdb() retrieves the subset of ws with...

Description Usage Arguments Value Examples

Description

Same as ws_data_na_2_pgdb() , retrieves the weather data from the intersecting stations. It is known that NOAA enlist available data for certain years, months, or days; however, some of this information is missing. This function replaces the missing data with the average value of the dataset. The example shows the use of ws_metadata_span_2_pgdb(), but it can be very well be replaced by ws_metadata_2_pgdb().

Usage

1
ws_data_avg_span_2_pgdb(ghcnd, geoid, type, span, ws_metadata)

Arguments

ghcnd

String that refers to the Global Historical Climate Network (daily) dataset

geoid

FIPS number from census tables

type

Variable under investigation i.e. TMAX, TMIN, PRCP

span

Indicates look-back time to search for available ws stations and data

ws_metadata

The table name of the subset of weather stations with intersecting data

Value

Returns the name of the table that has been created. When fail, it returns 1.

Examples

1
2
3
4
5
6
7
ghcnd        <- 'GHCND'
geoid        <- '12087'
type         <- 'TMAX'
stations     <- as.data.frame( all_coor_ws( ghcnd, geoid, type) )
span         <- '2'
ws_metadata  <- ws_metadata_span_2_pgdb( geoid, type, stations, span ) 
ws_data_avg_span_2_pgdb( ghcnd, geoid, type, span, ws_metadata)

rabravo/ws2pgdb documentation built on May 26, 2019, 8:51 p.m.