ws_data_na_span_2_pgdb: ws_data_na_span_2_pgdb() retrieves the subset of ws with data...

Description Usage Arguments Value Examples

Description

Retrieves the weather data from the intersecting stations. It is known that NOAA listed available data for certain years, months, or days; however, some of this information is missing. This function replaces the missing data with a NA value of the dataset. These value is read by the Postgres database as an empty cell. You can confirm this using pgAdmin3 or other database manager. The purpose of this function is to store the raw data, as it is, so that, the user can decide what to do with missing points ( i.e. extrapolate). 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_na_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

Look-back time to search and retrieve weather data information

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_na_span_2_pgdb(ghcnd, geoid, type, span, ws_metadata)

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