wrcc_createMeta: Obtain metadata for each station in a state.

View source: R/wrcc_createMeta.R

wrcc_createMetaR Documentation

Obtain metadata for each station in a state.

Description

Assembles individual station metadata from a WRCC webservice into a standardized dataframe. Metdata columns include:

  • deviceDeploymentID – unique identifier

  • deviceID – device identifier

  • locationID – location identifier

  • locationName – English language name

  • longitude – decimal degrees E

  • latitude – decimal degrees N

  • elevation – elevation of station in m

  • countryCode – ISO 3166-1 alpha-2

  • stateCode – ISO 3166-2 alpha-2

  • timezone – Olson time zone

  • nwsID – NWS station identifier

  • wrccID – WRCC station identifier (in WRCC data)

  • nessID – NESS station identifier (in WRCC data)

  • agencyName – responsible agency (in WRCC data)

Because of the large number of web requests required to assemble this metadata, it is recommended that the file be saved and reused by calling wrcc_loadMeta().

Usage

wrcc_createMeta(
  stateCode = NULL,
  wrccIDs = NULL,
  baseUrl = "https://raws.dri.edu/",
  verbose = TRUE
)

Arguments

stateCode

Two character state code (will be downcased).

wrccIDs

Vector of wrccIDs to be used instead of stateCode.

baseUrl

Base URL for data queries.

verbose

Logical flag controlling detailed progress statements.

Value

Dataframe of station metadata.

References

RAWS USA Climate Archive

See Also

wrcc_loadMeta

setRawsDataDir

Examples

## Not run: 
# Fail gracefully if any resources are not available
try({

library(RAWSmet)

wa_meta <- wrcc_createMeta(stateCode = 'WA', verbose = TRUE)

dplyr::glimpse(wa_meta, width = 75)

}, silent = FALSE)

## End(Not run)


MazamaScience/RAWSmet documentation built on May 6, 2023, 6:57 a.m.